Skip to content

Commit

Permalink
add code coverage to config
Browse files Browse the repository at this point in the history
  • Loading branch information
andrewconnell committed Dec 10, 2018
1 parent f157427 commit 13a2ea2
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 1 deletion.
8 changes: 8 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,13 @@ The following preset is used for SPFx projects:

```json
{
"collectCoverage": true,
"coverageDirectory": "<rootDir>/../temp/test",
"coverageReporters": [
"json",
"lcov",
"text-summary"
],
"moduleFileExtensions": [
"ts",
"tsx",
Expand Down Expand Up @@ -105,6 +112,7 @@ The following preset is used for SPFx projects:

Explanation of select configuration properties above:

- **collectCoverage**: collects code coverage statistics and generates associated reports in the `./temp/test` folder
- **moduleNameMapper**:
- when Jest sees a request for a CSS/SCSS file in the source files, it effectively ignores it using the `identity-obj-proxy` package
- when jest sees a request for `en-us.json`, it is provided a helper path to find the file
Expand Down
7 changes: 7 additions & 0 deletions jest-preset.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,11 @@
{
"collectCoverage": true,
"coverageDirectory": "<rootDir>/../temp/test",
"coverageReporters": [
"json",
"lcov",
"text-summary"
],
"moduleFileExtensions": [
"ts",
"tsx",
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@voitanos/jest-preset-spfx-react16",
"description": "Jest preset configuration for SharePoint Framework projects that leverage React v16 (SPFx >=1.7.0).",
"version": "1.0.0",
"version": "1.1.0",
"license": "MIT",
"dependencies": {
"@types/enzyme-adapter-react-16": "1.0.3",
Expand Down

0 comments on commit 13a2ea2

Please sign in to comment.