mirror of
https://github.com/chriswritescode-dev/opencode-manager.git
synced 2026-12-05 12:24:30 +01:00
24 lines
606 B
TypeScript
24 lines
606 B
TypeScript
import { rm } from 'node:fs/promises'
|
|
import type { FullResult, Reporter } from '@playwright/test/reporter'
|
|
import { REPORT_DIR, TEST_RESULTS_DIR } from './env'
|
|
|
|
export default class CleanupPassedRunReporter implements Reporter {
|
|
private status: FullResult['status'] | undefined
|
|
|
|
onEnd(result: FullResult) {
|
|
this.status = result.status
|
|
}
|
|
|
|
async onExit() {
|
|
if (this.status !== 'passed') return
|
|
await Promise.all([
|
|
rm(REPORT_DIR, { recursive: true, force: true }),
|
|
rm(TEST_RESULTS_DIR, { recursive: true, force: true }),
|
|
])
|
|
}
|
|
|
|
printsToStdio() {
|
|
return false
|
|
}
|
|
}
|