diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 21d36aa6c6..6a41e5c4c1 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -22,7 +22,13 @@ jobs: # and package-lock.json. Needs to run before npm install - run: node version-check.js - run: npm ci - - run: npm test + # Node 25 has a known incompatibility: extension-less files in "type: module" + # packages are treated as ESM, causing c8's require('yargs/yargs') to fail. + # Fall back to plain unit tests without coverage on Node 25 until upstream fixes this. + - if: matrix.node != '25' + run: npm test + - if: matrix.node == '25' + run: npm run test-no-coverage - run: npm run lint - run: npm audit --audit-level=critical - run: npm run build-with-tests && npm run test-transpiled diff --git a/package.json b/package.json index da91ce9d6b..8c470ea6ce 100644 --- a/package.json +++ b/package.json @@ -23,6 +23,7 @@ "generate": "./generate-client.sh", "watch": "tsc --watch", "test": "c8 node --test --test-reporter=spec --import tsx src/*_test.ts", + "test-no-coverage": "node --test --test-reporter=spec --import tsx src/*_test.ts", "test-transpiled": "node --test --test-reporter=spec dist/*_test.js", "integration-test": "tsx src/test/integration/index.ts", "prepare": "npm run build && husky",