Last active
April 15, 2019 19:30
-
-
Save andrewconnell/46d5ccdd285bfb41a4894ce48b7a9263 to your computer and use it in GitHub Desktop.
Jest v23.* configuration with code coverage for SPFx projects
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
{ | |
"collectCoverage": true, | |
"coverageDirectory": "<rootDir>/../temp/test", | |
"coverageReporters": [ | |
"json", | |
"lcov", | |
"text-summary" | |
], | |
"coverageThreshold": { | |
"global": { | |
"branches": 50, | |
"functions": 90, | |
"lines": 100, | |
"statements": 100 | |
} | |
}, | |
"moduleFileExtensions": [ | |
"ts", | |
"tsx", | |
"js", | |
"json" | |
], | |
"moduleNameMapper": { | |
"\\.(css|scss)$": "identity-obj-proxy", | |
"^resx-strings/en-us.json": "<rootDir>/node_modules/@microsoft/sp-core-library/lib/resx-strings/en-us.json" | |
}, | |
"reporters": | |
[ | |
"default", | |
[ | |
"jest-junit", | |
{ "output": "./temp/test/junit.xml" } | |
] | |
], | |
"rootDir": "../src", | |
"testMatch": [ | |
"**/src/**/*.spec.+(ts|tsx|js)" | |
], | |
"transform": { | |
"^.+\\.(ts|tsx)$": "ts-jest" | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment