Files
get-shit-done/scripts/run-tests.cjs
Lex Christopherson 02a5319777 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>
2026-02-27 10:07:02 -06:00

30 lines
823 B
JavaScript

#!/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');
const { join } = require('path');
const { execFileSync } = require('child_process');
const testDir = join(__dirname, '..', 'tests');
const files = readdirSync(testDir)
.filter(f => f.endsWith('.test.cjs'))
.sort()
.map(f => join('tests', f));
if (files.length === 0) {
console.error('No test files found in tests/');
process.exit(1);
}
try {
execFileSync(process.execPath, ['--test', ...files], {
stdio: 'inherit',
env: { ...process.env },
});
} catch (err) {
process.exit(err.status || 1);
}