|
1
|
"use strict"; |
|
2
|
var __defProp = Object.defineProperty; |
|
3
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor; |
|
4
|
var __getOwnPropNames = Object.getOwnPropertyNames; |
|
5
|
var __hasOwnProp = Object.prototype.hasOwnProperty; |
|
6
|
var __export = (target, all) => { |
|
7
|
for (var name in all) |
|
8
|
__defProp(target, name, { get: all[name], enumerable: true }); |
|
9
|
}; |
|
10
|
var __copyProps = (to, from, except, desc) => { |
|
11
|
if (from && typeof from === "object" || typeof from === "function") { |
|
12
|
for (let key of __getOwnPropNames(from)) |
|
13
|
if (!__hasOwnProp.call(to, key) && key !== except) |
|
14
|
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); |
|
15
|
} |
|
16
|
return to; |
|
17
|
}; |
|
18
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); |
|
19
|
var dot_exports = {}; |
|
20
|
__export(dot_exports, { |
|
21
|
default: () => dot_default |
|
22
|
}); |
|
23
|
module.exports = __toCommonJS(dot_exports); |
|
24
|
var import_base = require("./base"); |
|
25
|
class DotReporter extends import_base.TerminalReporter { |
|
26
|
constructor() { |
|
27
|
super(...arguments); |
|
28
|
this._counter = 0; |
|
29
|
} |
|
30
|
onBegin(suite) { |
|
31
|
super.onBegin(suite); |
|
32
|
this.writeLine(this.generateStartingMessage()); |
|
33
|
} |
|
34
|
onStdOut(chunk, test, result) { |
|
35
|
super.onStdOut(chunk, test, result); |
|
36
|
if (!this.config.quiet) |
|
37
|
this.screen.stdout.write(chunk); |
|
38
|
} |
|
39
|
onStdErr(chunk, test, result) { |
|
40
|
super.onStdErr(chunk, test, result); |
|
41
|
if (!this.config.quiet) |
|
42
|
this.screen.stderr.write(chunk); |
|
43
|
} |
|
44
|
onTestEnd(test, result) { |
|
45
|
super.onTestEnd(test, result); |
|
46
|
if (this._counter === 80) { |
|
47
|
this.screen.stdout.write("\n"); |
|
48
|
this._counter = 0; |
|
49
|
} |
|
50
|
++this._counter; |
|
51
|
if (result.status === "skipped") { |
|
52
|
this.screen.stdout.write(this.screen.colors.yellow("\xB0")); |
|
53
|
return; |
|
54
|
} |
|
55
|
if (this.willRetry(test)) { |
|
56
|
this.screen.stdout.write(this.screen.colors.gray("\xD7")); |
|
57
|
return; |
|
58
|
} |
|
59
|
switch (test.outcome()) { |
|
60
|
case "expected": |
|
61
|
this.screen.stdout.write(this.screen.colors.green("\xB7")); |
|
62
|
break; |
|
63
|
case "unexpected": |
|
64
|
this.screen.stdout.write(this.screen.colors.red(result.status === "timedOut" ? "T" : "F")); |
|
65
|
break; |
|
66
|
case "flaky": |
|
67
|
this.screen.stdout.write(this.screen.colors.yellow("\xB1")); |
|
68
|
break; |
|
69
|
} |
|
70
|
} |
|
71
|
onError(error) { |
|
72
|
super.onError(error); |
|
73
|
this.writeLine("\n" + this.formatError(error).message); |
|
74
|
this._counter = 0; |
|
75
|
} |
|
76
|
async onTestPaused(test, result) { |
|
77
|
if (!process.stdin.isTTY && !process.env.PW_TEST_DEBUG_REPORTERS) |
|
78
|
return; |
|
79
|
this.screen.stdout.write("\n"); |
|
80
|
if (test.outcome() === "unexpected") { |
|
81
|
this.writeLine(this.screen.colors.red(this.formatTestHeader(test, { indent: " " }))); |
|
82
|
this.writeLine(this.formatResultErrors(test, result)); |
|
83
|
(0, import_base.markErrorsAsReported)(result); |
|
84
|
this.writeLine(this.screen.colors.yellow(" Paused on error. Press Ctrl+C to end.") + "\n"); |
|
85
|
} else { |
|
86
|
this.writeLine(this.screen.colors.yellow(this.formatTestHeader(test, { indent: " " }))); |
|
87
|
this.writeLine(this.screen.colors.yellow(" Paused at test end. Press Ctrl+C to end.") + "\n"); |
|
88
|
} |
|
89
|
this._counter = 0; |
|
90
|
await new Promise(() => { |
|
91
|
}); |
|
92
|
} |
|
93
|
async onEnd(result) { |
|
94
|
await super.onEnd(result); |
|
95
|
this.screen.stdout.write("\n"); |
|
96
|
this.epilogue(true); |
|
97
|
} |
|
98
|
} |
|
99
|
var dot_default = DotReporter; |
|
100
|
|