Skip to content

Commit fc12c70

Browse files
BrainSlugs83Copilot
andcommitted
fix: split test/coverage scripts for Node 20 compat
Node 20 doesn't support --test-coverage-* threshold flags. - test: basic test run (all Node versions) - test:coverage: full coverage enforcement (Node 22+) - check: lint + test:coverage - CI: Node 22 runs check, Node 20 runs lint + test Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1 parent ce1ebf2 commit fc12c70

File tree

2 files changed

+10
-3
lines changed

2 files changed

+10
-3
lines changed

.github/workflows/ci.yml

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,4 +18,10 @@ jobs:
1818
with:
1919
node-version: ${{ matrix.node-version }}
2020
- run: npm ci
21-
- run: npm run check
21+
# Node 22+ supports coverage thresholds; Node 20 runs tests only
22+
- name: Lint + test with 100% coverage
23+
if: matrix.node-version >= 22
24+
run: npm run check
25+
- name: Lint + test (no coverage enforcement)
26+
if: matrix.node-version < 22
27+
run: npm run lint && npm test

package.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,9 @@
3838
],
3939
"scripts": {
4040
"lint": "eslint index.js vector-memory-server.js embed-worker.js lib.js",
41-
"test": "node --test --experimental-test-coverage --test-coverage-lines=100 --test-coverage-branches=100 --test-coverage-functions=100 --test-coverage-exclude=test.js test.js",
42-
"check": "npm run lint && npm run test"
41+
"test": "node --test test.js",
42+
"test:coverage": "node --test --experimental-test-coverage --test-coverage-lines=100 --test-coverage-branches=100 --test-coverage-functions=100 --test-coverage-exclude=test.js test.js",
43+
"check": "npm run lint && npm run test:coverage"
4344
},
4445
"dependencies": {
4546
"@modelcontextprotocol/sdk": "^1.0.0",

0 commit comments

Comments
 (0)