feat(reporters): add built-in "json" reporter and rename "default" to "pretty"
This commit is contained in:
parent
4e8ac5294d
commit
18382ce961
11 changed files with 102 additions and 16 deletions
14
packages/cli/src/reporters/get.ts
Normal file
14
packages/cli/src/reporters/get.ts
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
import { type Config } from '../types.js';
|
||||
import * as reporters from './index.js';
|
||||
|
||||
export const getStandardReporter = (reporter?: Config['reporter']) => {
|
||||
if (!reporter) {
|
||||
return reporters.pretty;
|
||||
}
|
||||
|
||||
if (typeof reporter === 'string' && reporter in reporters) {
|
||||
return reporters[reporter as keyof typeof reporters];
|
||||
}
|
||||
|
||||
return; // eslint-disable-line no-useless-return
|
||||
};
|
||||
Loading…
Add table
Add a link
Reference in a new issue