feat(script): add bun test summary detector

Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
This commit is contained in:
YeonGyu-Kim
2026-05-29 16:32:25 +09:00
parent e8dcdded12
commit 255a827135
2 changed files with 67 additions and 0 deletions
+25
View File
@@ -0,0 +1,25 @@
/// <reference types="bun-types" />
export const bunTestSummaryPattern = /^Ran [1-9][0-9]* tests across [1-9][0-9]* files?\./m
export function hasBunTestSummary(output: string): boolean {
return bunTestSummaryPattern.test(output)
}
async function assertTestSummaryFromLog(logPath: string): Promise<void> {
const output = await Bun.file(logPath).text()
if (!hasBunTestSummary(output)) {
throw new Error(`Missing bun test completion summary in ${logPath}`)
}
}
if (import.meta.main) {
const [logPath] = process.argv.slice(2)
if (!logPath) {
throw new Error("Usage: bun run script/assert-test-summary.ts <bun-test-log-path>")
}
await assertTestSummaryFromLog(logPath)
}