Generating JUnit Reports

How to generate JUnit Reports for common test runners

Jest

  1. Install jest-junit

$ npm install jest-junit --save-dev
  1. Update your Jest config to use the jest-junit reporter

{
  "reporters": [ "default", "jest-junit" ]
}

With this configuration, Jest runs will by default output a junit.xml file in the working directory. To further configure the reporter, consult the detailed documentation on GitHub.

Last updated