Skip to content

Commit dd85003

Browse files
authored
feat: add JSON reporter (#33)
1 parent ede99f6 commit dd85003

File tree

2 files changed

+5
-0
lines changed

2 files changed

+5
-0
lines changed

src/cli/arguments.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ const show_uncovered_options = {
1010
const reporters = {
1111
pretty: 'pretty',
1212
tap: 'tap',
13+
json: 'json',
1314
} as const
1415

1516
let CoverageDirSchema = v.pipe(v.string(), v.nonEmpty())

src/cli/cli.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,10 @@ async function cli(cli_args: string[]) {
2424
if (params.reporter === 'tap') {
2525
return tap(report, params)
2626
}
27+
if (params.reporter === 'json') {
28+
// oxlint-disable-next-line no-null
29+
return console.log(JSON.stringify(report))
30+
}
2731
return pretty(report, params)
2832
}
2933

0 commit comments

Comments
 (0)