fancive_obsidian-parallel-r.../scripts/run-tests.mjs
wujunchen 0bf5ab12b1 lint: extend Biome coverage to tests/ and scripts/
Add tests/**/*.js and scripts/**/*.mjs to biome.json includes and
update npm lint scripts to cover these directories. Auto-fixed all
formatting issues in 26 files.

Change-Id: I8c2763cb9683616a8abc1484d91bf8af79bb590e
2026-04-27 19:53:35 +08:00

24 lines
577 B
JavaScript

import { execSync } 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 path = join(testsDir, file);
try {
execSync(`node ${path}`, { 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.`);