-
-
Notifications
You must be signed in to change notification settings - Fork 24
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Configure Jest to generate JUnit formatted reports
Jest is able to generate JUnit formatted reports using the jest-junit (1) package. It has been defined in the main configuration file as additional reporter next to the `default` report format. See Circle CI's documentation about to how to collect test data (2) for more details about setups with Jest. References: (1) https://github.com/codecov/jest-junit (2) https://circleci.com/docs/2.0/collect-test-data/#jest GH-44
- Loading branch information
1 parent
dd1a155
commit 246857e
Showing
5 changed files
with
68 additions
and
36 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -13,10 +13,11 @@ | |
* @author Sven Greb <[email protected]> | ||
* @see https://jestjs.io/docs/en/configuration | ||
* @see https://www.gatsbyjs.org/docs/testing | ||
* @see https://circleci.com/docs/2.0/collect-test-data/#jest | ||
* @since 0.1.0 | ||
*/ | ||
|
||
const { BASE_DIR_BUILD_REPORTS_COVERAGE } = require("./src/config/internal/constants"); | ||
const { BASE_DIR_BUILD_REPORTS_COVERAGE, BASE_DIR_BUILD_REPORTS_JUNIT } = require("./src/config/internal/constants"); | ||
|
||
module.exports = { | ||
/* | ||
|
@@ -70,6 +71,20 @@ module.exports = { | |
*/ | ||
modulePaths: ["<rootDir>/test/__utils__"], | ||
|
||
/* | ||
* An array of module names to specify which reporters will be used. | ||
*/ | ||
reporters: [ | ||
"default", | ||
[ | ||
"jest-junit", | ||
{ | ||
outputDirectory: `${BASE_DIR_BUILD_REPORTS_JUNIT}`, | ||
outputName: "jest.xml" | ||
} | ||
] | ||
], | ||
|
||
/* | ||
* The paths to modules that run some code to configure or set up the testing environment before each test. | ||
* The `___loader` shim is a global function used by internal Gatsby APIs. | ||
|
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters