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