diff --git a/src/cli/arguments.ts b/src/cli/arguments.ts index 90dba63..d6efaf3 100644 --- a/src/cli/arguments.ts +++ b/src/cli/arguments.ts @@ -10,6 +10,7 @@ const show_uncovered_options = { const reporters = { pretty: 'pretty', tap: 'tap', + json: 'json', } as const let CoverageDirSchema = v.pipe(v.string(), v.nonEmpty()) diff --git a/src/cli/cli.ts b/src/cli/cli.ts index 02cd33b..30f189d 100644 --- a/src/cli/cli.ts +++ b/src/cli/cli.ts @@ -24,6 +24,10 @@ async function cli(cli_args: string[]) { if (params.reporter === 'tap') { return tap(report, params) } + if (params.reporter === 'json') { + // oxlint-disable-next-line no-null + return console.log(JSON.stringify(report)) + } return pretty(report, params) }