♻️ Run doc tests outside the coverage gate
An example that exercises a line no hand-written test reaches would let the `--100` gate pass on documentation alone. Node has no file-level exclusion, and c8's `--exclude` only filters the report, so run the two in separate processes: `test:coverage` runs c8 over the tracked tests only (`git ls-files`, which skips the untracked generated files), and `test:doc` runs the generated examples without c8. `test:ci` chains them.
This commit is contained in:
1 parent
a9b588e1c3
commit
4dc58395c0
3 files changed
+12
-3
No files matched your search
+3
-1
@@ -61,7 +61,9 @@
|
||||
"maintain:outdated": "check-outdated --ignore-pre-releases --ignore-packages @types/node",
|
||||
"test": "npm run check:tsc && node --test --strip-types \"src/**/*.test.ts\"",
|
||||
"pretest:ci": "npm run create:doc-tests",
|
||||
"test:ci": "c8 --all --include \"src/**/*.ts\" --reporter=text --reporter=lcov --reporter=html --100 node --test --strip-types \"src/**/*.test.ts\"",
|
||||
"test:ci": "npm run test:coverage && npm run test:doc",
|
||||
"test:coverage": "c8 --all --include \"src/**/*.ts\" --reporter=text --reporter=lcov --reporter=html --100 node --test --strip-types $(git ls-files 'src/*.test.ts')",
|
||||
"test:doc": "node --test --strip-types \"src/doc-test/__generated__/*.test.ts\"",
|
||||
"test:unit": "node --test --strip-types \"src/**/*.test.ts\"",
|
||||
"verify": "npm run check && npm run test:unit",
|
||||
"watch": "npm run watch:test",
|
||||
|
||||
Reference in new issue
Block a user