Skip to content
This repository has been archived by the owner on Oct 6, 2023. It is now read-only.

Commit

Permalink
feat(config): reporters
Browse files Browse the repository at this point in the history
  • Loading branch information
Akryum committed Dec 20, 2021
1 parent c058821 commit 7f0ea39
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 2 deletions.
3 changes: 3 additions & 0 deletions packages/peeky-config/src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ export type ModuleFilterOption<T = ModuleFilter> = T[] | T
export type SerializableModuleFilter = string | RegExp

export type SerializableRuntimeEnv = 'node' | 'dom'
export type BuiltinReporter = 'console-fancy'

export interface PeekyConfig {
targetDirectory?: string
match?: string | string[]
Expand All @@ -24,6 +26,7 @@ export interface PeekyConfig {
buildInclude?: ModuleFilterOption
vite?: ViteConfig
viteConfigFile?: string
reporters?: BuiltinReporter[]
}

export type SerializablePeekyConfig = Omit<PeekyConfig, 'runtimeEnv' | 'runtimeAvailableEnvs' | 'buildExclude' | 'buildInclude' | 'vite'> & {
Expand Down
6 changes: 5 additions & 1 deletion packages/peeky-runner/src/run-all.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,11 @@ export interface RunAllOptions {
}

export async function runAllTests (config: ProgramPeekyConfig, options: RunAllOptions = {}) {
const reporters = [
const reporters = config.reporters ? config.reporters.map(id => {
if (id === 'console-fancy') {
return createConsoleFancyReporter()
}
}) : [
createConsoleFancyReporter(),
]

Expand Down
1 change: 0 additions & 1 deletion packages/peeky-runner/src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -114,5 +114,4 @@ export interface Reporter {
errorSummary?: (payload: ErrorSummaryPayload) => unknown
coverageSummary?: (payload: CoverageSummaryPayload) => unknown
summary?: (payload: SummaryPayload) => unknown

}

0 comments on commit 7f0ea39

Please sign in to comment.