@travetto/test
Version:
Declarative test framework
23 lines (17 loc) • 495 B
text/typescript
import type { Writable } from 'node:stream';
import type { SuitesSummary } from '../types.ts';
import { TestConsumer } from '../registry.ts';
/**
* Returns the entire result set as a single JSON document
*/
()
export class JSONEmitter {
#stream: Writable;
constructor(stream: Writable = process.stdout) {
this.#stream = stream;
}
onEvent(): void { }
onSummary(summary: SuitesSummary): void {
this.#stream.write(JSON.stringify(summary, undefined, 2));
}
}