Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Jest v24.* configuration with code coverage for SPFx projects
{
"collectCoverage": true,
"collectCoverageFrom": [
"<rootDir>/**/*.{ts,tsx}",
"!<rootDir>/**/*.scss.*",
"!<rootDir>/loc/**/*.*"
],
"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
You can’t perform that action at this time.