File tree Expand file tree Collapse file tree 1 file changed +35
-0
lines changed
packages/react-scripts/template Expand file tree Collapse file tree 1 file changed +35
-0
lines changed Original file line number Diff line number Diff line change @@ -1374,6 +1374,41 @@ Run `npm test -- --coverage` (note extra `--` in the middle) to include a covera
13741374
13751375Note that tests run much slower with coverage so it is recommended to run it separately from your normal workflow.
13761376
1377+ #### Configuration
1378+
1379+ The default Jest coverage configuration can be overriden by adding any of the following supported keys to a Jest config in your package.json.
1380+
1381+ Supported overrides:
1382+ - [ ` collectCoverageFrom ` ] ( https://facebook.github.io/jest/docs/en/configuration.html#collectcoveragefrom-array )
1383+ - [ ` coverageReporters ` ] ( https://facebook.github.io/jest/docs/en/configuration.html#coveragereporters-array-string )
1384+ - [ ` coverageThreshold ` ] ( https://facebook.github.io/jest/docs/en/configuration.html#coveragethreshold-object )
1385+ - [ ` snapshotSerializers ` ] ( https://facebook.github.io/jest/docs/en/configuration.html#snapshotserializers-array-string )
1386+
1387+ Example package.json:
1388+
1389+ ``` json
1390+ {
1391+ "name" : " your-package" ,
1392+ "jest" : {
1393+ "collectCoverageFrom" : [
1394+ " src/**/*.{js,jsx}" ,
1395+ " !<rootDir>/node_modules/" ,
1396+ " !<rootDir>/path/to/dir/"
1397+ ],
1398+ "coverageThreshold" : {
1399+ "global" : {
1400+ "branches" : 90 ,
1401+ "functions" : 90 ,
1402+ "lines" : 90 ,
1403+ "statements" : 90
1404+ }
1405+ },
1406+ "coverageReporters" : [" text" ],
1407+ "snapshotSerializers" : [" my-serializer-module" ]
1408+ }
1409+ }
1410+ ```
1411+
13771412### Continuous Integration
13781413
13791414By default ` npm test ` runs the watcher with interactive CLI. However, you can force it to run tests once and finish the process by setting an environment variable called ` CI ` .
You can’t perform that action at this time.
0 commit comments