-
-
Notifications
You must be signed in to change notification settings - Fork 269
/
final-results.ts
38 lines (37 loc) · 1.05 KB
/
final-results.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
import { FinalPlan } from './final-plan.js'
import type { Parser } from './index.js'
import type { Result, TapError } from './result.js'
/**
* The summary results provided in the `complete` event when the TAP
* stream ends.
*/
export class FinalResults {
ok: boolean
count: number
pass: number
fail: number
bailout: boolean | string
todo: number
skip: number
failures: TapError[]
time: number | null
passes?: Result[]
plan: FinalPlan
skips: (Result & { skip: true | string })[]
todos: (Result & { todo: true | string })[]
constructor(skipAll: boolean, parser: Parser) {
this.ok = parser.ok
this.count = parser.count
this.pass = parser.pass
this.fail = parser.fail || 0
this.bailout = parser.bailedOut || false
this.todo = parser.todo || 0
this.skip = skipAll ? parser.count : parser.skip || 0
this.plan = new FinalPlan(skipAll, parser)
this.failures = parser.failures
this.passes = parser.passes || undefined
this.time = parser.time
this.skips = parser.skips
this.todos = parser.todos
}
}