mirror of
https://github.com/fancive/obsidian-parallel-reader.git
synced 2026-07-22 06:53:43 +00:00
- bump-version.mjs: reject duplicate versions (use --force to override), auto git-add manifest.json + versions.json for npm version hook - run-tests.mjs: use execFileSync to handle paths with spaces - test-setup.js: clean up esbuild temp directory on process exit Change-Id: I44410b550d09487dd7f5e30a8f9385a2c500252a
24 lines
593 B
JavaScript
24 lines
593 B
JavaScript
import { execFileSync } from 'child_process';
|
|
import { readdirSync } from 'fs';
|
|
import { join } from 'path';
|
|
|
|
const testsDir = join(import.meta.dirname, '..', 'tests');
|
|
const files = readdirSync(testsDir)
|
|
.filter((f) => f.endsWith('.test.js'))
|
|
.sort();
|
|
|
|
let failed = 0;
|
|
for (const file of files) {
|
|
const filePath = join(testsDir, file);
|
|
try {
|
|
execFileSync('node', [filePath], { stdio: 'inherit' });
|
|
} catch {
|
|
failed++;
|
|
}
|
|
}
|
|
|
|
if (failed > 0) {
|
|
console.error(`\n${failed} test file(s) failed.`);
|
|
process.exit(1);
|
|
}
|
|
console.log(`\nAll ${files.length} test files passed.`);
|