1
0
forked from rosa/hakurei

cmd/pkgserver: set exit code when running JS tests from CLI

This commit is contained in:
Kat
2026-03-22 05:51:41 +11:00
parent 8541fdd1f4
commit 90e7a63acc
2 changed files with 7 additions and 1 deletions

View File

@@ -43,4 +43,6 @@ if (args.length === 1) {
}
}
TESTS.run(new StreamReporter({ writeln: console.log }, verbose));
let reporter = new StreamReporter({ writeln: console.log }, verbose);
TESTS.run(reporter);
exit(reporter.succeeded() ? 0 : 1);

View File

@@ -198,6 +198,10 @@ export class StreamReporter implements Reporter {
this.#skips = [];
}
succeeded(): boolean {
return this.#successes.length > 0 && this.#failures.length === 0;
}
register(suites: TestGroup[]) {}
update(path: string[], result: TestResult) {