@@ -1246,6 +1246,9 @@ added:
1246
1246
- v18.9.0
1247
1247
- v16.19.0
1248
1248
changes:
1249
+ - version: REPLACEME
1250
+ pr-url: https://github.com/nodejs/node/pull/53937
1251
+ description: Added coverage options.
1249
1252
- version: REPLACEME
1250
1253
pr-url: https://github.com/nodejs/node/pull/53927
1251
1254
description: Added the `isolation` option.
@@ -1319,6 +1322,29 @@ changes:
1319
1322
that specifies the index of the shard to run. This option is _ required_ .
1320
1323
* ` total ` {number} is a positive integer that specifies the total number
1321
1324
of shards to split the test files to. This option is _ required_ .
1325
+ * ` coverage ` {boolean} enable [ code coverage] [ ] collection.
1326
+ ** Default:** ` false ` .
1327
+ * ` coverageExcludeGlobs ` {string|Array} Excludes specific files from code coverage
1328
+ using a glob pattern, which can match both absolute and relative file paths.
1329
+ This property is only applicable when ` coverage ` was set to ` true ` .
1330
+ If both ` coverageExcludeGlobs ` and ` coverageIncludeGlobs ` are provided,
1331
+ files must meet ** both** criteria to be included in the coverage report.
1332
+ ** Default:** ` undefined ` .
1333
+ * ` coverageIncludeGlobs ` {string|Array} Includes specific files in code coverage
1334
+ using a glob pattern, which can match both absolute and relative file paths.
1335
+ This property is only applicable when ` coverage ` was set to ` true ` .
1336
+ If both ` coverageExcludeGlobs ` and ` coverageIncludeGlobs ` are provided,
1337
+ files must meet ** both** criteria to be included in the coverage report.
1338
+ ** Default:** ` undefined ` .
1339
+ * ` lineCoverage ` {number} Require a minimum percent of covered lines. If code
1340
+ coverage does not reach the threshold specified, the process will exit with code ` 1 ` .
1341
+ ** Default:** ` 0 ` .
1342
+ * ` branchCoverage ` {number} Require a minimum percent of covered branches. If code
1343
+ coverage does not reach the threshold specified, the process will exit with code ` 1 ` .
1344
+ ** Default:** ` 0 ` .
1345
+ * ` functionCoverage ` {number} Require a minimum percent of covered functions. If code
1346
+ coverage does not reach the threshold specified, the process will exit with code ` 1 ` .
1347
+ ** Default:** ` 0 ` .
1322
1348
* Returns: {TestsStream}
1323
1349
1324
1350
** Note:** ` shard ` is used to horizontally parallelize test running across
@@ -3532,6 +3558,7 @@ Can be used to abort test subtasks when the test has been aborted.
3532
3558
[ `run()` ] : #runoptions
3533
3559
[ `suite()` ] : #suitename-options-fn
3534
3560
[ `test()` ] : #testname-options-fn
3561
+ [ code coverage ] : #collecting-code-coverage
3535
3562
[ describe options ] : #describename-options-fn
3536
3563
[ it options ] : #testname-options-fn
3537
3564
[ stream.compose ] : stream.md#streamcomposestreams
0 commit comments