Skip to content

Commit

Permalink
fix: report on skip events
Browse files Browse the repository at this point in the history
  • Loading branch information
ph-fritsche committed Nov 3, 2023
1 parent 1857c50 commit 1b6c017
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions src/reporter/ConsoleReporter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ const icon = {
}

const isEventType = makeEventTypeCheck<TestEventMap>()
const events: Array<keyof TestEventMap> = ['complete', 'done', 'error', 'result', 'schedule', 'start']
const events: Array<keyof TestEventMap> = ['complete', 'done', 'error', 'result', 'schedule', 'skip', 'start']

export class ConsoleReporter {
protected unsubscribe = new Map<TestRunStack, Set<() => void>>()
Expand All @@ -29,8 +29,7 @@ export class ConsoleReporter {
for (const k of events) {
set.add(runStack.addListener(k, e => this.log(e)))
}

set.add(runStack.addListener('done', () => {
const summary = () => {
for (const r of runStack.instances.values()) {
if (r.index.suites.pending.size || r.index.suites.running.size) {
return
Expand All @@ -44,7 +43,10 @@ export class ConsoleReporter {
this.printConductorSummary(runStack),
'',
].join('\n'))
}))
}

set.add(runStack.addListener('done', summary))
set.add(runStack.addListener('skip', summary))
}
}

Expand All @@ -60,6 +62,7 @@ export class ConsoleReporter {
result: true,
error: true,
done: false,
skip: false,
summary: true,
}

Expand Down

0 comments on commit 1b6c017

Please sign in to comment.