Skip to content

Instantly share code, notes, and snippets.

@andrewconnell
Last active April 15, 2019 19:30
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save andrewconnell/46d5ccdd285bfb41a4894ce48b7a9263 to your computer and use it in GitHub Desktop.
Save andrewconnell/46d5ccdd285bfb41a4894ce48b7a9263 to your computer and use it in GitHub Desktop.
Jest v23.* configuration with code coverage for SPFx projects
{
"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