# How to use xunit and nodejs

**URL:** <https://discuss.circleci.com/t/how-to-use-xunit-and-nodejs/10013>\
**Category:** Build Environment\
**Tags:** nodejs, circle-yml\
**Created:** [January 31, 2017, 4:11pm UTC](https://discuss.circleci.com/t/how-to-use-xunit-and-nodejs/10013 "2017-01-31T16:11:18Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![dijam](https://sea2.discourse-cdn.com/circleci/user_avatar/discuss.circleci.com/dijam/32/13170_2.png) [@dijam](https://discuss.circleci.com/u/dijam)\
**Post date:** [January 31, 2017, 4:11pm UTC](https://discuss.circleci.com/t/how-to-use-xunit-and-nodejs/10013/1 "2017-01-31T16:11:18Z")

</div>

So I saw xunit support in the documentation and tried it as it says.  
This is my circle.yml:

````auto
  override:
    - npm run test_junit:
        environment:
          MOCHA_FILE: $CIRCLE_TEST_REPORTS/junit/test-results.xml```

Everything is fine and I see this in my artifacts:
<img src="//circleci-discourse.s3.amazonaws.com/original/2X/7/7d41b768f94a3ef8cd3e42798101551b35f09175.png" width="602" height="138">

So I have two questions:
1- Why there is `$CIRCLE_TEST_REPORTS` there instead of `junit` or `testreports`? Did I do something wrong?
2- Is it what should happened after running the reporter? It puts a xml file in `artifacts`?

Thought this might help myself and others to understand this feature.
````

---

<div class="post-metadata">

**Author:** ![drazisil](https://sea2.discourse-cdn.com/circleci/user_avatar/discuss.circleci.com/drazisil/32/24029_2.png) [@drazisil](https://discuss.circleci.com/u/drazisil)\
**Post date:** [January 31, 2017, 4:18pm UTC](https://discuss.circleci.com/t/how-to-use-xunit-and-nodejs/10013/2 "2017-01-31T16:18:39Z")

</div>

Nope, that’s exactly right. It’s displayed as a tree, so `$CIRCLE_TEST_REPORTS/junit/test-results.xml`

The `test-results.xml` file is what the Mocha JUnit test runner outputs, and you told it to place it in `$CIRCLE_TEST_REPORTS/junit/`

We copy it to artifacts, because some users want to see te raw file, as well as the parsed results.

P.S. Our docs are [open source](https://github.com/circleci/circleci-docs), so we welcome pull requests if you think they can be clearer 🙂

---

<div class="post-metadata">

**Author:** ![dijam](https://sea2.discourse-cdn.com/circleci/user_avatar/discuss.circleci.com/dijam/32/13170_2.png) [@dijam](https://discuss.circleci.com/u/dijam)\
**Post date:** [January 31, 2017, 4:21pm UTC](https://discuss.circleci.com/t/how-to-use-xunit-and-nodejs/10013/3 "2017-01-31T16:21:31Z")

</div>

Cool, tnx. I also found that the `Test Summary` has some texts and describes what happened. I hope you guys add some fancy charts there besides the text 😉

---

<div class="post-metadata">

**Author:** ![drazisil](https://sea2.discourse-cdn.com/circleci/user_avatar/discuss.circleci.com/drazisil/32/24029_2.png) [@drazisil](https://discuss.circleci.com/u/drazisil)\
**Post date:** [January 31, 2017, 4:30pm UTC](https://discuss.circleci.com/t/how-to-use-xunit-and-nodejs/10013/4 "2017-01-31T16:30:43Z")

</div>

That would make a great feature request [https://discuss.circleci.com/c/feature-requests](https://discuss.circleci.com/c/feature-requests)

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/circleci/original/3X/5/1/511608acda8e85906e15909b57bd0a46c1dbe291.png) [@system](https://discuss.circleci.com/u/system)\
**Post date:** [June 18, 2018, 11:39am UTC](https://discuss.circleci.com/t/how-to-use-xunit-and-nodejs/10013/5 "2018-06-18T11:39:07Z")

</div>


