@wdio/reporter 7.20.3 → 7.20.8-alpha.504
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/constants.js +1 -4
- package/build/index.d.ts +7 -7
- package/build/index.d.ts.map +1 -1
- package/build/index.js +46 -49
- package/build/stats/hook.d.ts +1 -1
- package/build/stats/hook.d.ts.map +1 -1
- package/build/stats/hook.js +11 -9
- package/build/stats/runnable.d.ts +3 -3
- package/build/stats/runnable.d.ts.map +1 -1
- package/build/stats/runnable.js +5 -6
- package/build/stats/runner.d.ts +1 -1
- package/build/stats/runner.d.ts.map +1 -1
- package/build/stats/runner.js +15 -10
- package/build/stats/suite.d.ts +4 -4
- package/build/stats/suite.d.ts.map +1 -1
- package/build/stats/suite.js +19 -16
- package/build/stats/test.d.ts +2 -2
- package/build/stats/test.d.ts.map +1 -1
- package/build/stats/test.js +33 -22
- package/build/types.js +1 -2
- package/build/utils.d.ts +2 -2
- package/build/utils.d.ts.map +1 -1
- package/build/utils.js +9 -41
- package/package.json +21 -19
package/build/constants.js
CHANGED
package/build/index.d.ts
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
/// <reference types="node" />
|
|
2
2
|
/// <reference types="node" />
|
|
3
|
-
import type { WriteStream } from 'fs';
|
|
4
|
-
import { EventEmitter } from 'events';
|
|
3
|
+
import type { WriteStream } from 'node:fs';
|
|
4
|
+
import { EventEmitter } from 'node:events';
|
|
5
5
|
import type { Reporters } from '@wdio/types';
|
|
6
|
-
import SuiteStats from './stats/suite';
|
|
7
|
-
import HookStats from './stats/hook';
|
|
8
|
-
import TestStats, { Test } from './stats/test';
|
|
9
|
-
import RunnerStats from './stats/runner';
|
|
10
|
-
import { AfterCommandArgs, BeforeCommandArgs, CommandArgs, Tag, Argument } from './types';
|
|
6
|
+
import SuiteStats from './stats/suite.js';
|
|
7
|
+
import HookStats from './stats/hook.js';
|
|
8
|
+
import TestStats, { Test } from './stats/test.js';
|
|
9
|
+
import RunnerStats from './stats/runner.js';
|
|
10
|
+
import type { AfterCommandArgs, BeforeCommandArgs, CommandArgs, Tag, Argument } from './types';
|
|
11
11
|
declare type CustomWriteStream = {
|
|
12
12
|
write: (content: any) => boolean;
|
|
13
13
|
};
|
package/build/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;AACA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;AACA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,SAAS,CAAA;AAC1C,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAA;AAE1C,OAAO,KAAK,EAAE,SAAS,EAAW,MAAM,aAAa,CAAA;AAGrD,OAAO,UAAqB,MAAM,kBAAkB,CAAA;AACpD,OAAO,SAAmB,MAAM,iBAAiB,CAAA;AACjD,OAAO,SAAS,EAAE,EAAE,IAAI,EAAE,MAAM,iBAAiB,CAAA;AACjD,OAAO,WAAW,MAAM,mBAAmB,CAAA;AAC3C,OAAO,KAAK,EAAE,gBAAgB,EAAE,iBAAiB,EAAE,WAAW,EAAE,GAAG,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAA;AAE9F,aAAK,iBAAiB,GAAG;IAAE,KAAK,EAAE,CAAC,OAAO,EAAE,GAAG,KAAK,OAAO,CAAA;CAAE,CAAA;AAG7D,MAAM,CAAC,OAAO,OAAO,YAAa,SAAQ,YAAY;IAqB/B,OAAO,EAAE,OAAO,CAAC,SAAS,CAAC,OAAO,CAAC;IApBtD,YAAY,EAAE,WAAW,GAAG,iBAAiB,CAAA;IAC7C,QAAQ,SAAI;IACZ,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,UAAU,CAAC,CAAK;IACvC,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,SAAS,CAAC,CAAK;IACrC,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,SAAS,CAAC,CAAI;IACpC,aAAa,EAAE,UAAU,EAAE,CAAK;IAChC,MAAM;;;;;;;MAOL;IACD,OAAO,SAAI;IACX,UAAU,CAAC,EAAE,WAAW,CAAA;IACxB,gBAAgB,UAAQ;IACxB,KAAK,EAAE,MAAM,EAAE,CAAK;IACpB,WAAW,CAAC,EAAE,MAAM,CAAA;gBAED,OAAO,EAAE,OAAO,CAAC,SAAS,CAAC,OAAO,CAAC;IAyLtD;;;OAGG;IACH,IAAI,cAAc,YAEjB;IAED;;OAEG;IACH,KAAK,CAAC,OAAO,EAAE,GAAG;IASlB,aAAa,CAAC,WAAW,EAAE,WAAW;IAGtC,eAAe,CAAC,WAAW,EAAE,iBAAiB;IAG9C,cAAc,CAAC,WAAW,EAAE,gBAAgB;IAG5C,YAAY,CAAC,UAAU,EAAE,UAAU;IAGnC,WAAW,CAAC,QAAQ,EAAE,SAAS;IAG/B,SAAS,CAAC,SAAS,EAAE,SAAS;IAG9B,WAAW,CAAC,SAAS,EAAE,SAAS;IAGhC,UAAU,CAAC,SAAS,EAAE,SAAS;IAG/B,UAAU,CAAC,SAAS,EAAE,SAAS;IAG/B,WAAW,CAAC,SAAS,EAAE,SAAS;IAGhC,UAAU,CAAC,SAAS,EAAE,SAAS;IAG/B,SAAS,CAAC,SAAS,EAAE,SAAS;IAG9B,UAAU,CAAC,UAAU,EAAE,UAAU;IAGjC,WAAW,CAAC,WAAW,EAAE,WAAW;CACvC;AAED,OAAO,EACH,UAAU,EAAE,GAAG,EAAE,SAAS,EAAE,SAAS,EAAE,WAAW,EAAE,iBAAiB,EACrE,gBAAgB,EAAE,WAAW,EAAE,QAAQ,EAAE,IAAI,EAChD,CAAA"}
|
package/build/index.js
CHANGED
|
@@ -1,50 +1,47 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
};
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
const
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
1
|
+
import fs from 'node:fs';
|
|
2
|
+
import { EventEmitter } from 'node:events';
|
|
3
|
+
import logger from '@wdio/logger';
|
|
4
|
+
import { getErrorsFromEvent } from './utils.js';
|
|
5
|
+
import SuiteStats from './stats/suite.js';
|
|
6
|
+
import HookStats from './stats/hook.js';
|
|
7
|
+
import TestStats from './stats/test.js';
|
|
8
|
+
import RunnerStats from './stats/runner.js';
|
|
9
|
+
const log = logger('WDIOReporter');
|
|
10
|
+
export default class WDIOReporter extends EventEmitter {
|
|
11
|
+
options;
|
|
12
|
+
outputStream;
|
|
13
|
+
failures = 0;
|
|
14
|
+
suites = {};
|
|
15
|
+
hooks = {};
|
|
16
|
+
tests = {};
|
|
17
|
+
currentSuites = [];
|
|
18
|
+
counts = {
|
|
19
|
+
suites: 0,
|
|
20
|
+
tests: 0,
|
|
21
|
+
hooks: 0,
|
|
22
|
+
passes: 0,
|
|
23
|
+
skipping: 0,
|
|
24
|
+
failures: 0
|
|
25
|
+
};
|
|
26
|
+
retries = 0;
|
|
27
|
+
runnerStat;
|
|
28
|
+
isContentPresent = false;
|
|
29
|
+
specs = [];
|
|
30
|
+
currentSpec;
|
|
20
31
|
constructor(options) {
|
|
21
32
|
super();
|
|
22
33
|
this.options = options;
|
|
23
|
-
this.failures = 0;
|
|
24
|
-
this.suites = {};
|
|
25
|
-
this.hooks = {};
|
|
26
|
-
this.tests = {};
|
|
27
|
-
this.currentSuites = [];
|
|
28
|
-
this.counts = {
|
|
29
|
-
suites: 0,
|
|
30
|
-
tests: 0,
|
|
31
|
-
hooks: 0,
|
|
32
|
-
passes: 0,
|
|
33
|
-
skipping: 0,
|
|
34
|
-
failures: 0
|
|
35
|
-
};
|
|
36
|
-
this.retries = 0;
|
|
37
|
-
this.isContentPresent = false;
|
|
38
|
-
this.specs = [];
|
|
39
34
|
// ensure the report directory exists
|
|
40
35
|
if (this.options.outputDir) {
|
|
41
|
-
|
|
36
|
+
fs.mkdir(this.options.outputDir, { recursive: true }, (err) => {
|
|
37
|
+
err && log.error(`Couldn't create output dir: ${err.stack}`);
|
|
38
|
+
});
|
|
42
39
|
}
|
|
43
40
|
this.outputStream = (this.options.stdout || !this.options.logFile) && this.options.writeStream
|
|
44
41
|
? this.options.writeStream
|
|
45
|
-
:
|
|
42
|
+
: fs.createWriteStream(this.options.logFile);
|
|
46
43
|
let currentTest;
|
|
47
|
-
const rootSuite = new
|
|
44
|
+
const rootSuite = new SuiteStats({
|
|
48
45
|
title: '(root)',
|
|
49
46
|
fullTitle: '(root)',
|
|
50
47
|
file: ''
|
|
@@ -55,7 +52,7 @@ class WDIOReporter extends events_1.EventEmitter {
|
|
|
55
52
|
this.on('runner:start', /* istanbul ignore next */ (runner) => {
|
|
56
53
|
rootSuite.cid = runner.cid;
|
|
57
54
|
this.specs.push(...runner.specs);
|
|
58
|
-
this.runnerStat = new
|
|
55
|
+
this.runnerStat = new RunnerStats(runner);
|
|
59
56
|
this.onRunnerStart(this.runnerStat);
|
|
60
57
|
});
|
|
61
58
|
this.on('suite:start', /* istanbul ignore next */ (params) => {
|
|
@@ -69,7 +66,7 @@ class WDIOReporter extends events_1.EventEmitter {
|
|
|
69
66
|
: this.currentSpec;
|
|
70
67
|
this.currentSpec = params.file;
|
|
71
68
|
}
|
|
72
|
-
const suite = new
|
|
69
|
+
const suite = new SuiteStats(params);
|
|
73
70
|
const currentSuite = this.currentSuites[this.currentSuites.length - 1];
|
|
74
71
|
currentSuite.suites.push(suite);
|
|
75
72
|
this.currentSuites.push(suite);
|
|
@@ -77,7 +74,7 @@ class WDIOReporter extends events_1.EventEmitter {
|
|
|
77
74
|
this.onSuiteStart(suite);
|
|
78
75
|
});
|
|
79
76
|
this.on('hook:start', /* istanbul ignore next */ (hook) => {
|
|
80
|
-
const hookStats = new
|
|
77
|
+
const hookStats = new HookStats(hook);
|
|
81
78
|
const currentSuite = this.currentSuites[this.currentSuites.length - 1];
|
|
82
79
|
currentSuite.hooks.push(hookStats);
|
|
83
80
|
currentSuite.hooksAndTests.push(hookStats);
|
|
@@ -86,13 +83,13 @@ class WDIOReporter extends events_1.EventEmitter {
|
|
|
86
83
|
});
|
|
87
84
|
this.on('hook:end', /* istanbul ignore next */ (hook) => {
|
|
88
85
|
const hookStats = this.hooks[hook.uid];
|
|
89
|
-
hookStats.complete(
|
|
86
|
+
hookStats.complete(getErrorsFromEvent(hook));
|
|
90
87
|
this.counts.hooks++;
|
|
91
88
|
this.onHookEnd(hookStats);
|
|
92
89
|
});
|
|
93
90
|
this.on('test:start', /* istanbul ignore next */ (test) => {
|
|
94
91
|
test.retries = this.retries;
|
|
95
|
-
currentTest = new
|
|
92
|
+
currentTest = new TestStats(test);
|
|
96
93
|
const currentSuite = this.currentSuites[this.currentSuites.length - 1];
|
|
97
94
|
currentSuite.tests.push(currentTest);
|
|
98
95
|
currentSuite.hooksAndTests.push(currentTest);
|
|
@@ -115,21 +112,21 @@ class WDIOReporter extends events_1.EventEmitter {
|
|
|
115
112
|
});
|
|
116
113
|
this.on('test:fail', /* istanbul ignore next */ (test) => {
|
|
117
114
|
const testStat = this.tests[test.uid];
|
|
118
|
-
testStat.fail(
|
|
115
|
+
testStat.fail(getErrorsFromEvent(test));
|
|
119
116
|
this.counts.failures++;
|
|
120
117
|
this.counts.tests++;
|
|
121
118
|
this.onTestFail(testStat);
|
|
122
119
|
});
|
|
123
120
|
this.on('test:retry', (test) => {
|
|
124
121
|
const testStat = this.tests[test.uid];
|
|
125
|
-
testStat.fail(
|
|
122
|
+
testStat.fail(getErrorsFromEvent(test));
|
|
126
123
|
this.onTestRetry(testStat);
|
|
127
124
|
this.retries++;
|
|
128
125
|
});
|
|
129
126
|
this.on('test:pending', (test) => {
|
|
130
127
|
test.retries = this.retries;
|
|
131
128
|
const currentSuite = this.currentSuites[this.currentSuites.length - 1];
|
|
132
|
-
currentTest = new
|
|
129
|
+
currentTest = new TestStats(test);
|
|
133
130
|
/**
|
|
134
131
|
* In Mocha: tests that are skipped don't have a start event but a test end.
|
|
135
132
|
* In Jasmine: tests have a start event, therefore we need to replace the
|
|
@@ -173,8 +170,8 @@ class WDIOReporter extends events_1.EventEmitter {
|
|
|
173
170
|
this.onRunnerEnd(this.runnerStat);
|
|
174
171
|
}
|
|
175
172
|
const logFile = this.options.logFile;
|
|
176
|
-
if (!this.isContentPresent && logFile &&
|
|
177
|
-
|
|
173
|
+
if (!this.isContentPresent && logFile && fs.existsSync(logFile)) {
|
|
174
|
+
fs.unlinkSync(logFile);
|
|
178
175
|
}
|
|
179
176
|
});
|
|
180
177
|
/**
|
|
@@ -252,4 +249,4 @@ class WDIOReporter extends events_1.EventEmitter {
|
|
|
252
249
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
253
250
|
onRunnerEnd(runnerStats) { }
|
|
254
251
|
}
|
|
255
|
-
|
|
252
|
+
export { SuiteStats, HookStats, TestStats, RunnerStats };
|
package/build/stats/hook.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"hook.d.ts","sourceRoot":"","sources":["../../src/stats/hook.ts"],"names":[],"mappings":"AAAA,OAAO,aAAa,MAAM,
|
|
1
|
+
{"version":3,"file":"hook.d.ts","sourceRoot":"","sources":["../../src/stats/hook.ts"],"names":[],"mappings":"AAAA,OAAO,aAAa,MAAM,eAAe,CAAA;AAEzC,MAAM,WAAW,IAAI;IACjB,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,KAAK,EAAE,MAAM,CAAA;IACb,MAAM,EAAE,MAAM,CAAA;IACd,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,OAAO,CAAC,EAAE,OAAO,CAAA;IACjB,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,GAAG,EAAE,MAAM,CAAA;IACX,KAAK,CAAC,EAAE,MAAM,EAAE,CAAA;IAChB,GAAG,CAAC,EAAE,MAAM,CAAA;IACZ,MAAM,CAAC,EAAE,KAAK,EAAE,CAAA;IAChB,KAAK,CAAC,EAAE,KAAK,CAAA;IACb,WAAW,CAAC,EAAE,MAAM,CAAA;CACvB;AAED,MAAM,CAAC,OAAO,OAAO,SAAU,SAAQ,aAAa;IAChD,GAAG,EAAE,MAAM,CAAA;IACX,GAAG,EAAE,MAAM,CAAA;IACX,KAAK,EAAE,MAAM,CAAA;IACb,MAAM,EAAE,MAAM,CAAA;IACd,MAAM,CAAC,EAAE,KAAK,EAAE,CAAA;IAChB,KAAK,CAAC,EAAE,KAAK,CAAA;IACb,KAAK,CAAC,EAAE,QAAQ,GAAG,QAAQ,CAAA;IAC3B,WAAW,CAAC,EAAE,MAAM,CAAA;gBAEP,MAAM,EAAE,IAAI;IASzB,QAAQ,CAAE,MAAM,CAAC,EAAE,KAAK,EAAE;CAS7B"}
|
package/build/stats/hook.js
CHANGED
|
@@ -1,13 +1,16 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
1
|
+
import RunnableStats from './runnable.js';
|
|
2
|
+
export default class HookStats extends RunnableStats {
|
|
3
|
+
uid;
|
|
4
|
+
cid;
|
|
5
|
+
title;
|
|
6
|
+
parent;
|
|
7
|
+
errors;
|
|
8
|
+
error;
|
|
9
|
+
state;
|
|
10
|
+
currentTest;
|
|
8
11
|
constructor(runner) {
|
|
9
12
|
super('hook');
|
|
10
|
-
this.uid =
|
|
13
|
+
this.uid = RunnableStats.getIdentifier(runner);
|
|
11
14
|
this.cid = runner.cid;
|
|
12
15
|
this.title = runner.title;
|
|
13
16
|
this.parent = runner.parent;
|
|
@@ -22,4 +25,3 @@ class HookStats extends runnable_1.default {
|
|
|
22
25
|
super.complete();
|
|
23
26
|
}
|
|
24
27
|
}
|
|
25
|
-
exports.default = HookStats;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { Hook } from './hook';
|
|
2
|
-
import { Suite } from './suite';
|
|
3
|
-
import { Test } from './test';
|
|
1
|
+
import { Hook } from './hook.js';
|
|
2
|
+
import { Suite } from './suite.js';
|
|
3
|
+
import { Test } from './test.js';
|
|
4
4
|
/**
|
|
5
5
|
* Main class for a runnable class (e.g. test, suite or a hook)
|
|
6
6
|
* mainly used to capture its running duration
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"runnable.d.ts","sourceRoot":"","sources":["../../src/stats/runnable.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"runnable.d.ts","sourceRoot":"","sources":["../../src/stats/runnable.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAA;AAChC,OAAO,EAAE,KAAK,EAAE,MAAM,YAAY,CAAA;AAClC,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAA;AAEhC;;;GAGG;AACH,MAAM,CAAC,OAAO,CAAC,QAAQ,OAAO,aAAa;IAKnB,IAAI,EAAE,MAAM;IAJhC,KAAK,OAAa;IAClB,GAAG,CAAC,EAAE,IAAI,CAAA;IACV,SAAS,SAAI;gBAEO,IAAI,EAAE,MAAM;IAEhC,QAAQ;IAKR,IAAI,QAAQ,WAKX;IAED;;OAEG;IACH,MAAM,CAAC,aAAa,CAAE,MAAM,EAAE,IAAI,GAAG,KAAK,GAAG,IAAI;CAGpD"}
|
package/build/stats/runnable.js
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
1
|
/**
|
|
4
2
|
* Main class for a runnable class (e.g. test, suite or a hook)
|
|
5
3
|
* mainly used to capture its running duration
|
|
6
4
|
*/
|
|
7
|
-
class RunnableStats {
|
|
5
|
+
export default class RunnableStats {
|
|
6
|
+
type;
|
|
7
|
+
start = new Date();
|
|
8
|
+
end;
|
|
9
|
+
_duration = 0;
|
|
8
10
|
constructor(type) {
|
|
9
11
|
this.type = type;
|
|
10
|
-
this.start = new Date();
|
|
11
|
-
this._duration = 0;
|
|
12
12
|
}
|
|
13
13
|
complete() {
|
|
14
14
|
this.end = new Date();
|
|
@@ -27,4 +27,3 @@ class RunnableStats {
|
|
|
27
27
|
return runner.uid || runner.title;
|
|
28
28
|
}
|
|
29
29
|
}
|
|
30
|
-
exports.default = RunnableStats;
|
package/build/stats/runner.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"runner.d.ts","sourceRoot":"","sources":["../../src/stats/runner.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,OAAO,EAAE,MAAM,aAAa,CAAA;AAExD,OAAO,aAAa,MAAM,
|
|
1
|
+
{"version":3,"file":"runner.d.ts","sourceRoot":"","sources":["../../src/stats/runner.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,OAAO,EAAE,MAAM,aAAa,CAAA;AAExD,OAAO,aAAa,MAAM,eAAe,CAAA;AAGzC;;;GAGG;AACH,MAAM,CAAC,OAAO,OAAO,WAAY,SAAQ,aAAa;IAClD,GAAG,EAAE,MAAM,CAAA;IACX,YAAY,EAAE,YAAY,CAAC,gBAAgB,CAAA;IAC3C,qBAAqB,EAAE,MAAM,CAAA;IAC7B,MAAM,EAAE,OAAO,CAAC,UAAU,CAAA;IAC1B,KAAK,EAAE,MAAM,EAAE,CAAA;IACf,SAAS,EAAE,MAAM,CAAA;IACjB,aAAa,EAAE,OAAO,CAAA;IACtB,eAAe,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,WAAW,CAAC,CAAA;IACpD,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,OAAO,CAAC,EAAE,MAAM,CAAA;gBAEH,MAAM,EAAE,OAAO,CAAC,WAAW;CAY3C"}
|
package/build/stats/runner.js
CHANGED
|
@@ -1,20 +1,26 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
const runnable_1 = __importDefault(require("./runnable"));
|
|
7
|
-
const utils_1 = require("../utils");
|
|
1
|
+
import RunnableStats from './runnable.js';
|
|
2
|
+
import { sanitizeCaps } from '../utils.js';
|
|
8
3
|
/**
|
|
9
4
|
* Class to capture statistics about a test run. A test run is a single instance that
|
|
10
5
|
* runs one or more spec files
|
|
11
6
|
*/
|
|
12
|
-
class RunnerStats extends
|
|
7
|
+
export default class RunnerStats extends RunnableStats {
|
|
8
|
+
cid;
|
|
9
|
+
capabilities;
|
|
10
|
+
sanitizedCapabilities;
|
|
11
|
+
config;
|
|
12
|
+
specs;
|
|
13
|
+
sessionId;
|
|
14
|
+
isMultiremote;
|
|
15
|
+
instanceOptions;
|
|
16
|
+
retry;
|
|
17
|
+
failures;
|
|
18
|
+
retries;
|
|
13
19
|
constructor(runner) {
|
|
14
20
|
super('runner');
|
|
15
21
|
this.cid = runner.cid;
|
|
16
22
|
this.capabilities = runner.capabilities;
|
|
17
|
-
this.sanitizedCapabilities =
|
|
23
|
+
this.sanitizedCapabilities = sanitizeCaps(runner.capabilities);
|
|
18
24
|
this.config = runner.config;
|
|
19
25
|
this.specs = runner.specs;
|
|
20
26
|
this.sessionId = runner.sessionId;
|
|
@@ -23,4 +29,3 @@ class RunnerStats extends runnable_1.default {
|
|
|
23
29
|
this.retry = runner.retry;
|
|
24
30
|
}
|
|
25
31
|
}
|
|
26
|
-
exports.default = RunnerStats;
|
package/build/stats/suite.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import
|
|
1
|
+
import HookStats from './hook.js';
|
|
2
|
+
import RunnableStats from './runnable.js';
|
|
3
|
+
import TestStats from './test.js';
|
|
4
|
+
import type { Tag } from '../types';
|
|
5
5
|
export interface Suite {
|
|
6
6
|
type?: string;
|
|
7
7
|
title: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"suite.d.ts","sourceRoot":"","sources":["../../src/stats/suite.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"suite.d.ts","sourceRoot":"","sources":["../../src/stats/suite.ts"],"names":[],"mappings":"AAAA,OAAO,SAAS,MAAM,WAAW,CAAA;AACjC,OAAO,aAAa,MAAM,eAAe,CAAA;AACzC,OAAO,SAAS,MAAM,WAAW,CAAA;AACjC,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,UAAU,CAAA;AAEnC,MAAM,WAAW,KAAK;IAClB,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,KAAK,EAAE,MAAM,CAAA;IACb,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,SAAS,EAAE,MAAM,CAAA;IACjB,OAAO,CAAC,EAAE,OAAO,CAAA;IACjB,IAAI,EAAE,MAAM,CAAA;IACZ,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,GAAG,CAAC,EAAE,MAAM,CAAA;IACZ,KAAK,CAAC,EAAE,MAAM,EAAE,CAAA;IAChB,GAAG,CAAC,EAAE,MAAM,CAAA;IACZ,IAAI,CAAC,EAAE,MAAM,EAAE,GAAG,GAAG,EAAE,CAAA;IACvB,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,IAAI,CAAC,EAAE,MAAM,CAAA;CAChB;AAED;;GAEG;AACH,MAAM,CAAC,OAAO,OAAO,UAAW,SAAQ,aAAa;IACjD,GAAG,EAAE,MAAM,CAAA;IACX,GAAG,CAAC,EAAE,MAAM,CAAA;IACZ,IAAI,EAAE,MAAM,CAAA;IACZ,KAAK,EAAE,MAAM,CAAA;IACb,SAAS,EAAE,MAAM,CAAA;IACjB,IAAI,CAAC,EAAE,MAAM,EAAE,GAAG,GAAG,EAAE,CAAA;IACvB,KAAK,EAAE,SAAS,EAAE,CAAK;IACvB,KAAK,EAAE,SAAS,EAAE,CAAK;IACvB,MAAM,EAAE,UAAU,EAAE,CAAK;IACzB,MAAM,CAAC,EAAE,MAAM,CAAA;IACf;;OAEG;IACH,aAAa,EAAE,CAAC,SAAS,GAAG,SAAS,CAAC,EAAE,CAAK;IAC7C,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,IAAI,CAAC,EAAE,MAAM,CAAA;gBAEA,KAAK,EAAE,KAAK;CAe5B"}
|
package/build/stats/suite.js
CHANGED
|
@@ -1,23 +1,27 @@
|
|
|
1
|
-
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
const runnable_1 = __importDefault(require("./runnable"));
|
|
1
|
+
import RunnableStats from './runnable.js';
|
|
7
2
|
/**
|
|
8
3
|
* Class describing statistics about a single suite.
|
|
9
4
|
*/
|
|
10
|
-
class SuiteStats extends
|
|
5
|
+
export default class SuiteStats extends RunnableStats {
|
|
6
|
+
uid;
|
|
7
|
+
cid;
|
|
8
|
+
file;
|
|
9
|
+
title;
|
|
10
|
+
fullTitle;
|
|
11
|
+
tags;
|
|
12
|
+
tests = [];
|
|
13
|
+
hooks = [];
|
|
14
|
+
suites = [];
|
|
15
|
+
parent;
|
|
16
|
+
/**
|
|
17
|
+
* an array of hooks and tests stored in order as they happen
|
|
18
|
+
*/
|
|
19
|
+
hooksAndTests = [];
|
|
20
|
+
description;
|
|
21
|
+
rule;
|
|
11
22
|
constructor(suite) {
|
|
12
23
|
super(suite.type || 'suite');
|
|
13
|
-
this.
|
|
14
|
-
this.hooks = [];
|
|
15
|
-
this.suites = [];
|
|
16
|
-
/**
|
|
17
|
-
* an array of hooks and tests stored in order as they happen
|
|
18
|
-
*/
|
|
19
|
-
this.hooksAndTests = [];
|
|
20
|
-
this.uid = runnable_1.default.getIdentifier(suite);
|
|
24
|
+
this.uid = RunnableStats.getIdentifier(suite);
|
|
21
25
|
this.cid = suite.cid;
|
|
22
26
|
this.file = suite.file;
|
|
23
27
|
this.title = suite.title;
|
|
@@ -31,4 +35,3 @@ class SuiteStats extends runnable_1.default {
|
|
|
31
35
|
this.rule = suite.rule;
|
|
32
36
|
}
|
|
33
37
|
}
|
|
34
|
-
exports.default = SuiteStats;
|
package/build/stats/test.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import RunnableStats from './runnable';
|
|
2
|
-
import { Argument } from '../types';
|
|
1
|
+
import RunnableStats from './runnable.js';
|
|
2
|
+
import type { Argument } from '../types';
|
|
3
3
|
export interface Test {
|
|
4
4
|
type: 'test:start' | 'test:pass' | 'test:fail' | 'test:retry' | 'test:pending' | 'test:end' | 'test:skip';
|
|
5
5
|
title: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"test.d.ts","sourceRoot":"","sources":["../../src/stats/test.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"test.d.ts","sourceRoot":"","sources":["../../src/stats/test.ts"],"names":[],"mappings":"AAMA,OAAO,aAAa,MAAM,eAAe,CAAA;AAEzC,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,UAAU,CAAA;AAIxC,MAAM,WAAW,IAAI;IACjB,IAAI,EAAE,YAAY,GAAG,WAAW,GAAG,WAAW,GAAG,YAAY,GAAG,cAAc,GAAG,UAAU,GAAG,WAAW,CAAA;IACzG,KAAK,EAAE,MAAM,CAAA;IACb,MAAM,EAAE,MAAM,CAAA;IACd,SAAS,EAAE,MAAM,CAAA;IACjB,OAAO,EAAE,OAAO,CAAA;IAChB,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,GAAG,EAAE,MAAM,CAAA;IACX,KAAK,EAAE,MAAM,EAAE,CAAA;IACf,GAAG,EAAE,MAAM,CAAA;IACX,aAAa,CAAC,EAAE,MAAM,CAAA;IACtB,KAAK,CAAC,EAAE,KAAK,CAAA;IACb,MAAM,CAAC,EAAE,KAAK,EAAE,CAAA;IAChB,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB,QAAQ,CAAC,EAAE,MAAM,GAAG,QAAQ,CAAA;CAC/B;AAED,UAAU,MAAM;IACZ,OAAO,EAAE,MAAM,CAAA;IACf,MAAM,EAAE,GAAG,CAAA;IACX,MAAM,EAAE,KAAK,GAAG,MAAM,GAAG,KAAK,GAAG,QAAQ,CAAA;IACzC,QAAQ,EAAE,MAAM,CAAA;IAChB,IAAI,EAAE,EAAE,CAAA;IACR,MAAM,EAAE;QACJ,KAAK,EAAE,MAAM,GAAG,IAAI,CAAA;KACvB,CAAA;IACD,SAAS,EAAE,MAAM,CAAA;IACjB,GAAG,EAAE,MAAM,CAAA;IACX,IAAI,EAAE,SAAS,GAAG,QAAQ,CAAA;CAC7B;AAED;;;GAGG;AACH,MAAM,CAAC,OAAO,OAAO,SAAU,SAAQ,aAAa;IAChD,GAAG,EAAE,MAAM,CAAA;IACX,GAAG,EAAE,MAAM,CAAA;IACX,KAAK,EAAE,MAAM,CAAA;IACb,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,SAAS,EAAE,MAAM,CAAA;IACjB,MAAM,EAAE,MAAM,EAAE,CAAA;IAChB,QAAQ,CAAC,EAAE,MAAM,GAAG,QAAQ,CAAA;IAC5B,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB,MAAM,EAAE,MAAM,CAAA;IACd;;;OAGG;IACH,KAAK,EAAE,SAAS,GAAG,QAAQ,GAAG,SAAS,GAAG,QAAQ,CAAA;IAClD,aAAa,CAAC,EAAE,MAAM,CAAA;IACtB,MAAM,CAAC,EAAE,KAAK,EAAE,CAAA;IAChB,KAAK,CAAC,EAAE,KAAK,CAAA;gBAED,IAAI,EAAE,IAAI;IAkBtB,IAAI;IAKJ,IAAI,CAAC,MAAM,EAAE,MAAM;IAKnB,IAAI,CAAC,MAAM,CAAC,EAAE,KAAK,EAAE;IA2BrB,OAAO,CAAC,kBAAkB;CAmC7B"}
|
package/build/stats/test.js
CHANGED
|
@@ -1,22 +1,34 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
const diff_1 = require("diff");
|
|
7
|
-
const object_inspect_1 = __importDefault(require("object-inspect"));
|
|
8
|
-
const runnable_1 = __importDefault(require("./runnable"));
|
|
9
|
-
const utils_1 = require("../utils");
|
|
10
|
-
const util_1 = require("util");
|
|
1
|
+
import { types as nodeUtilTypes } from 'node:util';
|
|
2
|
+
import { diffWordsWithSpace } from 'diff';
|
|
3
|
+
import objectInspect from 'object-inspect';
|
|
4
|
+
import RunnableStats from './runnable.js';
|
|
5
|
+
import { pad, color, colorLines } from '../utils.js';
|
|
11
6
|
const maxStringLength = 2048;
|
|
12
7
|
/**
|
|
13
8
|
* TestStats class
|
|
14
9
|
* captures data on a test.
|
|
15
10
|
*/
|
|
16
|
-
class TestStats extends
|
|
11
|
+
export default class TestStats extends RunnableStats {
|
|
12
|
+
uid;
|
|
13
|
+
cid;
|
|
14
|
+
title;
|
|
15
|
+
currentTest;
|
|
16
|
+
fullTitle;
|
|
17
|
+
output;
|
|
18
|
+
argument;
|
|
19
|
+
retries;
|
|
20
|
+
parent;
|
|
21
|
+
/**
|
|
22
|
+
* initial test state is pending
|
|
23
|
+
* the state can change to the following: passed, skipped, failed
|
|
24
|
+
*/
|
|
25
|
+
state;
|
|
26
|
+
pendingReason;
|
|
27
|
+
errors;
|
|
28
|
+
error;
|
|
17
29
|
constructor(test) {
|
|
18
30
|
super('test');
|
|
19
|
-
this.uid =
|
|
31
|
+
this.uid = RunnableStats.getIdentifier(test);
|
|
20
32
|
this.cid = test.cid;
|
|
21
33
|
this.title = test.title;
|
|
22
34
|
this.fullTitle = test.fullTitle;
|
|
@@ -45,11 +57,11 @@ class TestStats extends runnable_1.default {
|
|
|
45
57
|
* Iterates through all errors to check if they're a type of 'AssertionError',
|
|
46
58
|
* and formats it if so. Otherwise, just leaves error as is
|
|
47
59
|
*/
|
|
48
|
-
const formattedErrors = errors
|
|
60
|
+
const formattedErrors = errors?.map((err) => (
|
|
49
61
|
/**
|
|
50
62
|
* only format if error object has either an "expected" or "actual" property set
|
|
51
63
|
*/
|
|
52
|
-
((err.expected || err.actual) && !
|
|
64
|
+
((err.expected || err.actual) && !nodeUtilTypes.isProxy(err.actual)) &&
|
|
53
65
|
/**
|
|
54
66
|
* and if they aren't already formated, e.g. in Jasmine
|
|
55
67
|
*/
|
|
@@ -63,13 +75,13 @@ class TestStats extends runnable_1.default {
|
|
|
63
75
|
}
|
|
64
76
|
_stringifyDiffObjs(err) {
|
|
65
77
|
const inspectOpts = { maxStringLength };
|
|
66
|
-
const expected = (
|
|
67
|
-
const actual = (
|
|
68
|
-
let msg =
|
|
78
|
+
const expected = objectInspect(err.expected, inspectOpts);
|
|
79
|
+
const actual = objectInspect(err.actual, inspectOpts);
|
|
80
|
+
let msg = diffWordsWithSpace(actual, expected)
|
|
69
81
|
.map((str) => (str.added
|
|
70
|
-
?
|
|
82
|
+
? colorLines('diff added inline', str.value)
|
|
71
83
|
: str.removed
|
|
72
|
-
?
|
|
84
|
+
? colorLines('diff removed inline', str.value)
|
|
73
85
|
: str.value))
|
|
74
86
|
.join('');
|
|
75
87
|
// linenos
|
|
@@ -78,12 +90,12 @@ class TestStats extends runnable_1.default {
|
|
|
78
90
|
const width = String(lines.length).length;
|
|
79
91
|
msg = lines
|
|
80
92
|
.map(function (str, i) {
|
|
81
|
-
return
|
|
93
|
+
return pad(String(++i), width) + ' |' + ' ' + str;
|
|
82
94
|
})
|
|
83
95
|
.join('\n');
|
|
84
96
|
}
|
|
85
97
|
// legend
|
|
86
|
-
msg = `\n${
|
|
98
|
+
msg = `\n${color('diff removed inline', 'actual')} ${color('diff added inline', 'expected')}\n\n${msg}\n`;
|
|
87
99
|
// indent
|
|
88
100
|
msg = msg.replace(/^/gm, ' ');
|
|
89
101
|
const newError = new Error(err.message + msg);
|
|
@@ -91,4 +103,3 @@ class TestStats extends runnable_1.default {
|
|
|
91
103
|
return newError;
|
|
92
104
|
}
|
|
93
105
|
}
|
|
94
|
-
exports.default = TestStats;
|
package/build/types.js
CHANGED
|
@@ -1,2 +1 @@
|
|
|
1
|
-
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
1
|
+
export {};
|
package/build/utils.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { Capabilities } from '@wdio/types';
|
|
2
|
-
import { COLORS } from './constants';
|
|
1
|
+
import type { Capabilities } from '@wdio/types';
|
|
2
|
+
import { COLORS } from './constants.js';
|
|
3
3
|
/**
|
|
4
4
|
* replaces whitespaces with underscore and removes dots
|
|
5
5
|
* @param {String} str variable to sanitize
|
package/build/utils.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../src/utils.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAA;
|
|
1
|
+
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../src/utils.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,aAAa,CAAA;AAE/C,OAAO,EAAE,MAAM,EAAE,MAAM,gBAAgB,CAAA;AAEvC;;;;GAIG;AACH,wBAAgB,cAAc,CAAE,GAAG,CAAC,EAAE,MAAM,UAU3C;AAED;;;GAGG;AACH,wBAAgB,YAAY,CAAE,IAAI,CAAC,EAAE,YAAY,CAAC,mBAAmB,UA4BpE;AAED;;;;;;;GAOG;AACH,wBAAgB,kBAAkB,CAAC,CAAC,EAAE;IAAE,MAAM,CAAC,EAAE,GAAG,CAAC;IAAC,KAAK,CAAC,EAAE,GAAG,CAAA;CAAE,OAIlE;AAED;;;;;;;GAOG;AACH,wBAAgB,GAAG,CAAE,GAAG,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,UAE5C;AAED,wBAAgB,KAAK,CAAE,IAAI,EAAE,MAAM,OAAO,MAAM,EAAE,OAAO,EAAE,MAAM,UAKhE;AAED;;;;;;;GAOG;AACH,wBAAgB,UAAU,CAAE,IAAI,EAAE,MAAM,OAAO,MAAM,EAAE,GAAG,EAAE,MAAM,UAKjE"}
|
package/build/utils.js
CHANGED
|
@@ -1,37 +1,11 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
-
}) : function(o, v) {
|
|
16
|
-
o["default"] = v;
|
|
17
|
-
});
|
|
18
|
-
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
-
if (mod && mod.__esModule) return mod;
|
|
20
|
-
var result = {};
|
|
21
|
-
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
-
__setModuleDefault(result, mod);
|
|
23
|
-
return result;
|
|
24
|
-
};
|
|
25
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
|
-
exports.colorLines = exports.color = exports.pad = exports.getErrorsFromEvent = exports.sanitizeCaps = exports.sanitizeString = void 0;
|
|
27
|
-
const supportsColor = __importStar(require("supports-color"));
|
|
28
|
-
const constants_1 = require("./constants");
|
|
1
|
+
import supportsColor from 'supports-color';
|
|
2
|
+
import { COLORS } from './constants.js';
|
|
29
3
|
/**
|
|
30
4
|
* replaces whitespaces with underscore and removes dots
|
|
31
5
|
* @param {String} str variable to sanitize
|
|
32
6
|
* @return {String} sanitized variable
|
|
33
7
|
*/
|
|
34
|
-
function sanitizeString(str) {
|
|
8
|
+
export function sanitizeString(str) {
|
|
35
9
|
if (!str) {
|
|
36
10
|
return '';
|
|
37
11
|
}
|
|
@@ -41,12 +15,11 @@ function sanitizeString(str) {
|
|
|
41
15
|
.replace(/\s/g, '')
|
|
42
16
|
.toLowerCase();
|
|
43
17
|
}
|
|
44
|
-
exports.sanitizeString = sanitizeString;
|
|
45
18
|
/**
|
|
46
19
|
* formats capability object into sanitized string for e.g.filenames
|
|
47
20
|
* @param {Object} caps Selenium capabilities
|
|
48
21
|
*/
|
|
49
|
-
function sanitizeCaps(caps) {
|
|
22
|
+
export function sanitizeCaps(caps) {
|
|
50
23
|
if (!caps) {
|
|
51
24
|
return '';
|
|
52
25
|
}
|
|
@@ -73,7 +46,6 @@ function sanitizeCaps(caps) {
|
|
|
73
46
|
result = result.filter(n => n !== undefined && n !== '');
|
|
74
47
|
return result.join('.');
|
|
75
48
|
}
|
|
76
|
-
exports.sanitizeCaps = sanitizeCaps;
|
|
77
49
|
/**
|
|
78
50
|
* Takes a event emitted by a framework and extracts
|
|
79
51
|
* an array of errors representing test or hook failures.
|
|
@@ -82,14 +54,13 @@ exports.sanitizeCaps = sanitizeCaps;
|
|
|
82
54
|
* have a hard assertion model (Mocha)
|
|
83
55
|
* @param {*} e An event emitted by a framework adapter
|
|
84
56
|
*/
|
|
85
|
-
function getErrorsFromEvent(e) {
|
|
57
|
+
export function getErrorsFromEvent(e) {
|
|
86
58
|
if (e.errors)
|
|
87
59
|
return e.errors;
|
|
88
60
|
if (e.error)
|
|
89
61
|
return [e.error];
|
|
90
62
|
return [];
|
|
91
63
|
}
|
|
92
|
-
exports.getErrorsFromEvent = getErrorsFromEvent;
|
|
93
64
|
/**
|
|
94
65
|
* Pads the given `str` to `len`.
|
|
95
66
|
*
|
|
@@ -98,17 +69,15 @@ exports.getErrorsFromEvent = getErrorsFromEvent;
|
|
|
98
69
|
* @param {number} len
|
|
99
70
|
* @return {string}
|
|
100
71
|
*/
|
|
101
|
-
function pad(str, len) {
|
|
72
|
+
export function pad(str, len) {
|
|
102
73
|
return Array(len - str.length + 1).join(' ') + str;
|
|
103
74
|
}
|
|
104
|
-
|
|
105
|
-
function color(type, content) {
|
|
75
|
+
export function color(type, content) {
|
|
106
76
|
if (!supportsColor.stdout) {
|
|
107
77
|
return String(content);
|
|
108
78
|
}
|
|
109
|
-
return `\u001b[${
|
|
79
|
+
return `\u001b[${COLORS[type]}m${content}\u001b[0m`;
|
|
110
80
|
}
|
|
111
|
-
exports.color = color;
|
|
112
81
|
/**
|
|
113
82
|
* Colors lines for `str`, using the color `name`.
|
|
114
83
|
*
|
|
@@ -117,10 +86,9 @@ exports.color = color;
|
|
|
117
86
|
* @param {string} str
|
|
118
87
|
* @return {string}
|
|
119
88
|
*/
|
|
120
|
-
function colorLines(name, str) {
|
|
89
|
+
export function colorLines(name, str) {
|
|
121
90
|
return str
|
|
122
91
|
.split('\n')
|
|
123
92
|
.map((str) => color(name, str))
|
|
124
93
|
.join('\n');
|
|
125
94
|
}
|
|
126
|
-
exports.colorLines = colorLines;
|
package/package.json
CHANGED
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wdio/reporter",
|
|
3
|
-
"version": "7.20.
|
|
3
|
+
"version": "7.20.8-alpha.504+428a9d729",
|
|
4
4
|
"description": "A WebdriverIO utility to help reporting all events",
|
|
5
5
|
"author": "Christian Bromann <mail@bromann.dev>",
|
|
6
6
|
"homepage": "https://github.com/webdriverio/webdriverio/tree/main/packages/wdio-reporter",
|
|
7
7
|
"license": "MIT",
|
|
8
|
-
"main": "./build/index",
|
|
9
8
|
"engines": {
|
|
10
|
-
"node": ">=
|
|
9
|
+
"node": "^16.13 || >=18"
|
|
11
10
|
},
|
|
12
11
|
"repository": {
|
|
13
12
|
"type": "git",
|
|
14
|
-
"url": "git://github.com/webdriverio/webdriverio.git"
|
|
13
|
+
"url": "git://github.com/webdriverio/webdriverio.git",
|
|
14
|
+
"directory": "packages/wdio-reporter"
|
|
15
15
|
},
|
|
16
16
|
"keywords": [
|
|
17
17
|
"webdriver",
|
|
@@ -21,25 +21,27 @@
|
|
|
21
21
|
"bugs": {
|
|
22
22
|
"url": "https://github.com/webdriverio/webdriverio/issues"
|
|
23
23
|
},
|
|
24
|
-
"devDependencies": {
|
|
25
|
-
"@types/fs-extra": "^9.0.1",
|
|
26
|
-
"tmp": "^0.2.0"
|
|
27
|
-
},
|
|
28
24
|
"publishConfig": {
|
|
29
25
|
"access": "public"
|
|
30
26
|
},
|
|
27
|
+
"type": "module",
|
|
28
|
+
"exports": "./build/index.js",
|
|
29
|
+
"types": "./build/index.d.ts",
|
|
30
|
+
"typeScriptVersion": "3.8.3",
|
|
31
31
|
"dependencies": {
|
|
32
|
-
"@types/diff": "^5.0.
|
|
33
|
-
"@types/
|
|
34
|
-
"@types/
|
|
35
|
-
"@types/
|
|
36
|
-
"@
|
|
37
|
-
"@wdio/types": "7.20.
|
|
32
|
+
"@types/diff": "^5.0.2",
|
|
33
|
+
"@types/object-inspect": "^1.8.1",
|
|
34
|
+
"@types/supports-color": "^8.1.1",
|
|
35
|
+
"@types/tmp": "^0.2.3",
|
|
36
|
+
"@wdio/logger": "7.20.8-alpha.504+428a9d729",
|
|
37
|
+
"@wdio/types": "7.20.8-alpha.504+428a9d729",
|
|
38
38
|
"diff": "^5.0.0",
|
|
39
|
-
"
|
|
40
|
-
"
|
|
41
|
-
"supports-color": "8.1.1"
|
|
39
|
+
"object-inspect": "^1.12.0",
|
|
40
|
+
"supports-color": "9.2.3"
|
|
42
41
|
},
|
|
43
|
-
"
|
|
44
|
-
|
|
42
|
+
"devDependencies": {
|
|
43
|
+
"@types/node": "^18.0.0",
|
|
44
|
+
"tmp": "^0.2.1"
|
|
45
|
+
},
|
|
46
|
+
"gitHead": "428a9d729ae6231968a60908732fa3f607d195e9"
|
|
45
47
|
}
|