fix(ci): propagate coverage env in cross-platform test runner
The run-tests.cjs child process now inherits NODE_V8_COVERAGE from the parent so c8 collects coverage data. Also restores npm scripts to use the cross-platform runner for both test and test:coverage commands. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
#!/usr/bin/env node
|
||||
// Cross-platform test runner — resolves test file globs via Node
|
||||
// instead of relying on shell expansion (which fails on Windows PowerShell/cmd).
|
||||
// Propagates NODE_V8_COVERAGE so c8 collects coverage from the child process.
|
||||
'use strict';
|
||||
|
||||
const { readdirSync } = require('fs');
|
||||
@@ -19,7 +20,10 @@ if (files.length === 0) {
|
||||
}
|
||||
|
||||
try {
|
||||
execFileSync(process.execPath, ['--test', ...files], { stdio: 'inherit' });
|
||||
execFileSync(process.execPath, ['--test', ...files], {
|
||||
stdio: 'inherit',
|
||||
env: { ...process.env },
|
||||
});
|
||||
} catch (err) {
|
||||
process.exit(err.status || 1);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user