@wdio/reporter 9.0.0-alpha.78 → 9.0.0
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/index.cjs +752 -0
- package/build/index.d.ts +1 -3
- package/build/index.d.ts.map +1 -1
- package/build/index.js +709 -257
- package/build/stats/runner.d.ts +1 -1
- package/build/stats/runner.d.ts.map +1 -1
- package/build/utils.d.ts +1 -2
- package/build/utils.d.ts.map +1 -1
- package/package.json +10 -14
- package/build/constants.js +0 -23
- package/build/stats/hook.js +0 -30
- package/build/stats/runnable.js +0 -29
- package/build/stats/runner.js +0 -31
- package/build/stats/suite.js +0 -37
- package/build/stats/test.js +0 -108
- package/build/supportsColor.js +0 -146
- package/build/types.js +0 -1
- package/build/utils.js +0 -93
- package/cjs/constants.js +0 -26
- package/cjs/index.js +0 -271
- package/cjs/package.json +0 -5
- package/cjs/stats/hook.js +0 -36
- package/cjs/stats/runnable.js +0 -32
- package/cjs/stats/runner.js +0 -37
- package/cjs/stats/suite.js +0 -43
- package/cjs/stats/test.js +0 -114
- package/cjs/supportsColor.js +0 -153
- package/cjs/types.js +0 -2
- package/cjs/utils.js +0 -105
- package/tsconfig.cjs.json +0 -10
- /package/{LICENSE-MIT → LICENSE} +0 -0
package/cjs/types.js
DELETED
package/cjs/utils.js
DELETED
|
@@ -1,105 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
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
|
-
exports.colorLines = exports.color = exports.pad = exports.getErrorsFromEvent = exports.sanitizeCaps = exports.sanitizeString = void 0;
|
|
7
|
-
const supportsColor_js_1 = __importDefault(require("./supportsColor.js"));
|
|
8
|
-
const constants_js_1 = require("./constants.js");
|
|
9
|
-
/**
|
|
10
|
-
* replaces whitespaces with underscore and removes dots
|
|
11
|
-
* @param {string} str variable to sanitize
|
|
12
|
-
* @return {String} sanitized variable
|
|
13
|
-
*/
|
|
14
|
-
function sanitizeString(str) {
|
|
15
|
-
if (!str) {
|
|
16
|
-
return '';
|
|
17
|
-
}
|
|
18
|
-
return String(str)
|
|
19
|
-
.replace(/^.*\/([^/]+)\/?$/, '$1')
|
|
20
|
-
.replace(/\./g, '_')
|
|
21
|
-
.replace(/\s/g, '')
|
|
22
|
-
.toLowerCase();
|
|
23
|
-
}
|
|
24
|
-
exports.sanitizeString = sanitizeString;
|
|
25
|
-
/**
|
|
26
|
-
* formats capability object into sanitized string for e.g.filenames
|
|
27
|
-
* @param {object} caps Selenium capabilities
|
|
28
|
-
*/
|
|
29
|
-
function sanitizeCaps(caps) {
|
|
30
|
-
if (!caps) {
|
|
31
|
-
return '';
|
|
32
|
-
}
|
|
33
|
-
let result;
|
|
34
|
-
/**
|
|
35
|
-
* mobile caps
|
|
36
|
-
*/
|
|
37
|
-
result = caps.deviceName
|
|
38
|
-
? [
|
|
39
|
-
sanitizeString(caps.platformName),
|
|
40
|
-
sanitizeString(caps.deviceName || caps['appium:deviceName']),
|
|
41
|
-
sanitizeString(caps['appium:platformVersion']),
|
|
42
|
-
sanitizeString(caps['appium:app'])
|
|
43
|
-
]
|
|
44
|
-
: [
|
|
45
|
-
sanitizeString(caps.browserName),
|
|
46
|
-
sanitizeString(caps.version || caps.browserVersion),
|
|
47
|
-
sanitizeString(caps.platform || caps.platformName),
|
|
48
|
-
sanitizeString(caps['appium:app'])
|
|
49
|
-
];
|
|
50
|
-
result = result.filter(n => n !== undefined && n !== '');
|
|
51
|
-
return result.join('.');
|
|
52
|
-
}
|
|
53
|
-
exports.sanitizeCaps = sanitizeCaps;
|
|
54
|
-
/**
|
|
55
|
-
* Takes a event emitted by a framework and extracts
|
|
56
|
-
* an array of errors representing test or hook failures.
|
|
57
|
-
* This exists to maintain compatibility between frameworks
|
|
58
|
-
* with have a soft assertion model (Jasmine) and those that
|
|
59
|
-
* have a hard assertion model (Mocha)
|
|
60
|
-
* @param {*} e An event emitted by a framework adapter
|
|
61
|
-
*/
|
|
62
|
-
function getErrorsFromEvent(e) {
|
|
63
|
-
if (e.errors) {
|
|
64
|
-
return e.errors;
|
|
65
|
-
}
|
|
66
|
-
if (e.error) {
|
|
67
|
-
return [e.error];
|
|
68
|
-
}
|
|
69
|
-
return [];
|
|
70
|
-
}
|
|
71
|
-
exports.getErrorsFromEvent = getErrorsFromEvent;
|
|
72
|
-
/**
|
|
73
|
-
* Pads the given `str` to `len`.
|
|
74
|
-
*
|
|
75
|
-
* @private
|
|
76
|
-
* @param {string} str
|
|
77
|
-
* @param {number} len
|
|
78
|
-
* @return {string}
|
|
79
|
-
*/
|
|
80
|
-
function pad(str, len) {
|
|
81
|
-
return Array(len - str.length + 1).join(' ') + str;
|
|
82
|
-
}
|
|
83
|
-
exports.pad = pad;
|
|
84
|
-
function color(type, content) {
|
|
85
|
-
if (!supportsColor_js_1.default.stdout) {
|
|
86
|
-
return String(content);
|
|
87
|
-
}
|
|
88
|
-
return `\u001b[${constants_js_1.COLORS[type]}m${content}\u001b[0m`;
|
|
89
|
-
}
|
|
90
|
-
exports.color = color;
|
|
91
|
-
/**
|
|
92
|
-
* Colors lines for `str`, using the color `name`.
|
|
93
|
-
*
|
|
94
|
-
* @private
|
|
95
|
-
* @param {string} name
|
|
96
|
-
* @param {string} str
|
|
97
|
-
* @return {string}
|
|
98
|
-
*/
|
|
99
|
-
function colorLines(name, str) {
|
|
100
|
-
return str
|
|
101
|
-
.split('\n')
|
|
102
|
-
.map((str) => color(name, str))
|
|
103
|
-
.join('\n');
|
|
104
|
-
}
|
|
105
|
-
exports.colorLines = colorLines;
|
package/tsconfig.cjs.json
DELETED
/package/{LICENSE-MIT → LICENSE}
RENAMED
|
File without changes
|