@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/cjs/types.js DELETED
@@ -1,2 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
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
@@ -1,10 +0,0 @@
1
- {
2
- "extends": "./tsconfig.prod.json",
3
- "compilerOptions": {
4
- "module": "CommonJS",
5
- "moduleResolution": "Node",
6
- "outDir": "./cjs",
7
- "declaration": false,
8
- "declarationMap": false
9
- }
10
- }
File without changes