mirror of
https://github.com/zhw2590582/ArtPlayer.git
synced 2026-10-08 19:06:15 -08:00
9 lines
429 B
JavaScript
9 lines
429 B
JavaScript
export default async function* contractReporter(events) {
|
|
for await (const event of events) {
|
|
if (['test:pass', 'test:fail', 'test:summary'].includes(event.type)) {
|
|
const { name, file, nesting, skip, todo, counts, success, details } = event.data
|
|
yield `${JSON.stringify({ type: event.type, name, file, nesting, skip, todo, counts, success, kind: details?.type, error: details?.error?.message })}\n`
|
|
}
|
|
}
|
|
}
|