@testomatio/reporter 2.0.1-beta.5-timestamp → 2.0.1-beta.7
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/README.md +1 -0
- package/lib/adapter/codecept.d.ts +2 -0
- package/lib/adapter/codecept.js +297 -335
- package/lib/adapter/cucumber/current.d.ts +14 -0
- package/lib/adapter/cucumber/current.js +195 -203
- package/lib/adapter/cucumber/legacy.d.ts +0 -0
- package/lib/adapter/cucumber/legacy.js +130 -155
- package/lib/adapter/cucumber.d.ts +2 -0
- package/lib/adapter/cucumber.js +5 -16
- package/lib/adapter/cypress-plugin/index.d.ts +2 -0
- package/lib/adapter/cypress-plugin/index.js +91 -105
- package/lib/adapter/jasmine.d.ts +11 -0
- package/lib/adapter/jasmine.js +54 -53
- package/lib/adapter/jest.d.ts +13 -0
- package/lib/adapter/jest.js +97 -99
- package/lib/adapter/mocha.d.ts +2 -0
- package/lib/adapter/mocha.js +112 -141
- package/lib/adapter/nightwatch.d.ts +4 -0
- package/lib/adapter/nightwatch.js +80 -0
- package/lib/adapter/playwright.d.ts +14 -0
- package/lib/adapter/playwright.js +208 -231
- package/lib/adapter/vitest.d.ts +35 -0
- package/lib/adapter/vitest.js +150 -149
- package/lib/adapter/webdriver.d.ts +24 -0
- package/lib/adapter/webdriver.js +144 -121
- package/lib/bin/cli.d.ts +2 -0
- package/lib/bin/cli.js +229 -211
- package/lib/bin/reportXml.d.ts +2 -0
- package/lib/bin/reportXml.js +51 -52
- package/lib/bin/startTest.d.ts +2 -0
- package/lib/bin/startTest.js +83 -95
- package/lib/bin/uploadArtifacts.d.ts +2 -0
- package/lib/bin/uploadArtifacts.js +56 -61
- package/lib/client.d.ts +76 -0
- package/lib/client.js +431 -465
- package/lib/config.d.ts +1 -0
- package/lib/config.js +18 -23
- package/lib/constants.d.ts +25 -0
- package/lib/constants.js +50 -44
- package/lib/data-storage.d.ts +34 -0
- package/lib/data-storage.js +216 -188
- package/lib/junit-adapter/adapter.d.ts +9 -0
- package/lib/junit-adapter/adapter.js +17 -20
- package/lib/junit-adapter/csharp.d.ts +5 -0
- package/lib/junit-adapter/csharp.js +28 -14
- package/lib/junit-adapter/index.d.ts +3 -0
- package/lib/junit-adapter/index.js +27 -25
- package/lib/junit-adapter/java.d.ts +5 -0
- package/lib/junit-adapter/java.js +41 -53
- package/lib/junit-adapter/javascript.d.ts +4 -0
- package/lib/junit-adapter/javascript.js +30 -27
- package/lib/junit-adapter/python.d.ts +5 -0
- package/lib/junit-adapter/python.js +38 -37
- package/lib/junit-adapter/ruby.d.ts +4 -0
- package/lib/junit-adapter/ruby.js +11 -8
- package/lib/output.d.ts +11 -0
- package/lib/output.js +44 -52
- package/lib/package.json +3 -0
- package/lib/pipe/bitbucket.d.ts +25 -0
- package/lib/pipe/bitbucket.js +223 -230
- package/lib/pipe/csv.d.ts +47 -0
- package/lib/pipe/csv.js +113 -126
- package/lib/pipe/debug.d.ts +29 -0
- package/lib/pipe/debug.js +125 -99
- package/lib/pipe/github.d.ts +30 -0
- package/lib/pipe/github.js +218 -213
- package/lib/pipe/gitlab.d.ts +25 -0
- package/lib/pipe/gitlab.js +183 -206
- package/lib/pipe/html.d.ts +35 -0
- package/lib/pipe/html.js +258 -321
- package/lib/pipe/index.d.ts +1 -0
- package/lib/pipe/index.js +94 -66
- package/lib/pipe/testomatio.d.ts +71 -0
- package/lib/pipe/testomatio.js +429 -474
- package/lib/replay.d.ts +31 -0
- package/lib/replay.js +255 -0
- package/lib/reporter-functions.d.ts +41 -0
- package/lib/reporter-functions.js +64 -26
- package/lib/reporter.d.ts +235 -0
- package/lib/reporter.js +37 -29
- package/lib/services/artifacts.d.ts +33 -0
- package/lib/services/artifacts.js +55 -51
- package/lib/services/index.d.ts +11 -0
- package/lib/services/index.js +16 -12
- package/lib/services/key-values.d.ts +27 -0
- package/lib/services/key-values.js +56 -53
- package/lib/services/labels.d.ts +22 -0
- package/lib/services/labels.js +62 -0
- package/lib/services/logger.d.ts +64 -0
- package/lib/services/logger.js +226 -245
- package/lib/template/testomatio.hbs +1026 -1366
- package/lib/uploader.d.ts +60 -0
- package/lib/uploader.js +295 -364
- package/lib/utils/pipe_utils.d.ts +41 -0
- package/lib/utils/pipe_utils.js +89 -85
- package/lib/utils/utils.d.ts +54 -0
- package/lib/utils/utils.js +398 -307
- package/lib/xmlReader.d.ts +92 -0
- package/lib/xmlReader.js +525 -532
- package/package.json +64 -21
- package/src/adapter/codecept.js +377 -0
- package/src/adapter/cucumber/current.js +228 -0
- package/src/adapter/cucumber/legacy.js +158 -0
- package/src/adapter/cucumber.js +4 -0
- package/src/adapter/cypress-plugin/index.js +110 -0
- package/src/adapter/jasmine.js +60 -0
- package/src/adapter/jest.js +107 -0
- package/src/adapter/mocha.cjs +2 -0
- package/src/adapter/mocha.js +156 -0
- package/src/adapter/nightwatch.js +88 -0
- package/src/adapter/playwright.js +258 -0
- package/src/adapter/vitest.js +183 -0
- package/src/adapter/webdriver.js +142 -0
- package/src/bin/cli.js +348 -0
- package/src/bin/reportXml.js +77 -0
- package/src/bin/startTest.js +124 -0
- package/src/bin/uploadArtifacts.js +91 -0
- package/src/client.js +519 -0
- package/src/config.js +30 -0
- package/src/constants.js +53 -0
- package/src/data-storage.js +204 -0
- package/src/junit-adapter/adapter.js +23 -0
- package/src/junit-adapter/csharp.js +28 -0
- package/src/junit-adapter/index.js +28 -0
- package/src/junit-adapter/java.js +58 -0
- package/src/junit-adapter/javascript.js +31 -0
- package/src/junit-adapter/python.js +42 -0
- package/src/junit-adapter/ruby.js +10 -0
- package/src/output.js +57 -0
- package/src/pipe/bitbucket.js +252 -0
- package/src/pipe/csv.js +140 -0
- package/src/pipe/debug.js +125 -0
- package/src/pipe/github.js +232 -0
- package/src/pipe/gitlab.js +247 -0
- package/src/pipe/html.js +373 -0
- package/src/pipe/index.js +71 -0
- package/src/pipe/testomatio.js +504 -0
- package/src/replay.js +262 -0
- package/src/reporter-functions.js +96 -0
- package/src/reporter.cjs_decprecated +21 -0
- package/src/reporter.js +36 -0
- package/src/services/artifacts.js +59 -0
- package/src/services/index.js +15 -0
- package/src/services/key-values.js +59 -0
- package/src/services/labels.js +59 -0
- package/src/services/logger.js +315 -0
- package/src/template/emptyData.svg +23 -0
- package/src/template/testomatio.hbs +1081 -0
- package/src/uploader.js +376 -0
- package/src/utils/pipe_utils.js +119 -0
- package/src/utils/utils.js +416 -0
- package/src/xmlReader.js +614 -0
|
@@ -1,23 +1,20 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
1
3
|
class Adapter {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
formatMessage(t) {
|
|
19
|
-
return t.message;
|
|
20
|
-
}
|
|
4
|
+
constructor(opts) {
|
|
5
|
+
this.opts = opts;
|
|
6
|
+
}
|
|
7
|
+
getFilePath(t) {
|
|
8
|
+
return t.file;
|
|
9
|
+
}
|
|
10
|
+
formatTest(t) {
|
|
11
|
+
return t;
|
|
12
|
+
}
|
|
13
|
+
formatStack(t) {
|
|
14
|
+
return t.stack || '';
|
|
15
|
+
}
|
|
16
|
+
formatMessage(t) {
|
|
17
|
+
return t.message;
|
|
18
|
+
}
|
|
21
19
|
}
|
|
22
|
-
|
|
23
20
|
module.exports = Adapter;
|
|
@@ -1,16 +1,30 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
t
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
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
|
+
const path_1 = __importDefault(require("path"));
|
|
7
|
+
const adapter_js_1 = __importDefault(require("./adapter.js"));
|
|
8
|
+
class CSharpAdapter extends adapter_js_1.default {
|
|
9
|
+
formatTest(t) {
|
|
10
|
+
const title = t.title.replace(/\(.*?\)/, '').trim();
|
|
11
|
+
const example = t.title.match(/\((.*?)\)/);
|
|
12
|
+
if (example)
|
|
13
|
+
t.example = { ...example[1].split(',') };
|
|
14
|
+
const suite = t.suite_title.split('.');
|
|
15
|
+
t.suite_title = suite.pop();
|
|
16
|
+
t.file = namespaceToFileName(t.file);
|
|
17
|
+
t.title = title.trim();
|
|
18
|
+
return t;
|
|
19
|
+
}
|
|
20
|
+
getFilePath(t) {
|
|
21
|
+
const fileName = namespaceToFileName(t.file);
|
|
22
|
+
return fileName;
|
|
23
|
+
}
|
|
14
24
|
}
|
|
15
|
-
|
|
16
25
|
module.exports = CSharpAdapter;
|
|
26
|
+
function namespaceToFileName(fileName) {
|
|
27
|
+
const fileParts = fileName.split('.');
|
|
28
|
+
fileParts[fileParts.length - 1] = fileParts[fileParts.length - 1]?.replace(/\$.*/, '');
|
|
29
|
+
return `${fileParts.join(path_1.default.sep)}.cs`;
|
|
30
|
+
}
|
|
@@ -1,28 +1,30 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
const
|
|
7
|
-
|
|
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
|
+
const adapter_js_1 = __importDefault(require("./adapter.js"));
|
|
7
|
+
const javascript_js_1 = __importDefault(require("./javascript.js"));
|
|
8
|
+
const java_js_1 = __importDefault(require("./java.js"));
|
|
9
|
+
const python_js_1 = __importDefault(require("./python.js"));
|
|
10
|
+
const ruby_js_1 = __importDefault(require("./ruby.js"));
|
|
11
|
+
const csharp_js_1 = __importDefault(require("./csharp.js"));
|
|
8
12
|
function AdapterFactory(lang, opts) {
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
return new Adapter(opts);
|
|
13
|
+
if (lang === 'java') {
|
|
14
|
+
return new java_js_1.default(opts);
|
|
15
|
+
}
|
|
16
|
+
if (lang === 'js') {
|
|
17
|
+
return new javascript_js_1.default(opts);
|
|
18
|
+
}
|
|
19
|
+
if (lang === 'python') {
|
|
20
|
+
return new python_js_1.default(opts);
|
|
21
|
+
}
|
|
22
|
+
if (lang === 'ruby') {
|
|
23
|
+
return new ruby_js_1.default(opts);
|
|
24
|
+
}
|
|
25
|
+
if (lang === 'c#' || lang === 'csharp') {
|
|
26
|
+
return new csharp_js_1.default(opts);
|
|
27
|
+
}
|
|
28
|
+
return new adapter_js_1.default(opts);
|
|
26
29
|
}
|
|
27
|
-
|
|
28
30
|
module.exports = AdapterFactory;
|
|
@@ -1,58 +1,46 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
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
|
+
const path_1 = __importDefault(require("path"));
|
|
7
|
+
const adapter_js_1 = __importDefault(require("./adapter.js"));
|
|
8
|
+
class JavaAdapter extends adapter_js_1.default {
|
|
9
|
+
getFilePath(t) {
|
|
10
|
+
const fileName = namespaceToFileName(t.suite_title);
|
|
11
|
+
return this.opts.javaTests + path_1.default.sep + fileName;
|
|
12
|
+
}
|
|
13
|
+
formatTest(t) {
|
|
14
|
+
const fileParts = t.suite_title.split('.');
|
|
15
|
+
t.file = namespaceToFileName(t.suite_title);
|
|
16
|
+
t.title = t.title.split('(')[0];
|
|
17
|
+
// detect params
|
|
18
|
+
const paramMatches = t.title.match(/\[(.*?)\]/g);
|
|
19
|
+
if (paramMatches) {
|
|
20
|
+
const params = paramMatches.map((_match, index) => `param${index + 1}`);
|
|
21
|
+
if (params.length === 1)
|
|
22
|
+
params[0] = 'param';
|
|
23
|
+
let paramIndex = 0;
|
|
24
|
+
t.title = t.title.replace(/: \[(.*?)\]/g, () => {
|
|
25
|
+
if (params.length < 2)
|
|
26
|
+
return `\${param}`;
|
|
27
|
+
const paramName = params[paramIndex] || `param${paramIndex + 1}`;
|
|
28
|
+
paramIndex++;
|
|
29
|
+
return `\${${paramName}}`;
|
|
30
|
+
});
|
|
31
|
+
const example = {};
|
|
32
|
+
paramMatches.forEach((match, index) => {
|
|
33
|
+
example[params[index]] = match.replace(/[[\]]/g, '');
|
|
34
|
+
});
|
|
35
|
+
t.example = example;
|
|
36
|
+
}
|
|
37
|
+
t.suite_title = fileParts[fileParts.length - 1].replace(/\$/g, ' | ');
|
|
38
|
+
return t;
|
|
35
39
|
}
|
|
36
|
-
|
|
37
|
-
t.suite_title = fileParts[fileParts.length - 1].replace(/\$/g, ' | ');
|
|
38
|
-
return t;
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
// formatStack(t) {
|
|
42
|
-
// const stack = super.formatStack(t);
|
|
43
|
-
|
|
44
|
-
// const file = t.suite_title.split('.');
|
|
45
|
-
|
|
46
|
-
// const fileLine = `at .*${file[file.length - 1]}\.java:(\\d+)` // eslint-disable-line no-useless-escape
|
|
47
|
-
// const regexp = new RegExp(fileLine,"g")
|
|
48
|
-
// return stack.replace(regexp, `${this.opts.javaTests}${path.sep}${namespaceToFileName(t.suite_title)}:$1:`);
|
|
49
|
-
// }
|
|
50
40
|
}
|
|
51
|
-
|
|
52
41
|
function namespaceToFileName(fileName) {
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
42
|
+
const fileParts = fileName.split('.');
|
|
43
|
+
fileParts[fileParts.length - 1] = fileParts[fileParts.length - 1]?.replace(/\$.*/, '');
|
|
44
|
+
return `${fileParts.join(path_1.default.sep)}.java`;
|
|
56
45
|
}
|
|
57
|
-
|
|
58
46
|
module.exports = JavaAdapter;
|
|
@@ -1,30 +1,33 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
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
|
+
const callsite_record_1 = __importDefault(require("callsite-record"));
|
|
7
|
+
const path_1 = __importDefault(require("path"));
|
|
8
|
+
const adapter_js_1 = __importDefault(require("./adapter.js"));
|
|
9
|
+
class JavaScriptAdapter extends adapter_js_1.default {
|
|
10
|
+
formatStack(t) {
|
|
11
|
+
let stack = super.formatStack(t);
|
|
12
|
+
try {
|
|
13
|
+
const error = new Error(stack.split('\n')[0]);
|
|
14
|
+
error.stack = stack;
|
|
15
|
+
const record = (0, callsite_record_1.default)({
|
|
16
|
+
forError: error,
|
|
17
|
+
});
|
|
18
|
+
// @ts-ignore
|
|
19
|
+
if (record && !record.filename.startsWith('http')) {
|
|
20
|
+
stack += record.renderSync({
|
|
21
|
+
stackFilter: frame => frame.fileName?.indexOf(path_1.default.sep) > -1 &&
|
|
22
|
+
frame.fileName?.indexOf('node_modules') < 0 &&
|
|
23
|
+
frame.fileName?.indexOf('internal') < 0,
|
|
24
|
+
});
|
|
25
|
+
}
|
|
26
|
+
return stack;
|
|
27
|
+
}
|
|
28
|
+
catch (err) {
|
|
29
|
+
return stack;
|
|
30
|
+
}
|
|
26
31
|
}
|
|
27
|
-
}
|
|
28
32
|
}
|
|
29
|
-
|
|
30
33
|
module.exports = JavaScriptAdapter;
|
|
@@ -1,42 +1,43 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
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
|
+
const path_1 = __importDefault(require("path"));
|
|
7
|
+
const fs_1 = __importDefault(require("fs"));
|
|
8
|
+
const adapter_js_1 = __importDefault(require("./adapter.js"));
|
|
9
|
+
class PythonAdapter extends adapter_js_1.default {
|
|
10
|
+
getFilePath(t) {
|
|
11
|
+
let fileName = namespaceToFileName(t.suite_title, { checkFile: true });
|
|
12
|
+
if (!fileName)
|
|
13
|
+
fileName = namespaceToFileName(t.suite_title, { checkFile: false });
|
|
14
|
+
return fileName;
|
|
15
|
+
}
|
|
16
|
+
formatTest(t) {
|
|
17
|
+
const fileParts = t.suite_title.split('.');
|
|
18
|
+
const example = t.title.match(/\[(.*)\]/)?.[1];
|
|
19
|
+
if (example)
|
|
20
|
+
t.example = { '#': example };
|
|
21
|
+
t.file = namespaceToFileName(t.suite_title);
|
|
22
|
+
t.title = t.title.split('[')[0];
|
|
23
|
+
t.suite_title = fileParts[fileParts.length - 1].replace(/\$/g, ' | ');
|
|
24
|
+
return t;
|
|
25
|
+
}
|
|
26
|
+
formatMessage(t) {
|
|
27
|
+
return t.message.split(' ')[0];
|
|
28
|
+
}
|
|
26
29
|
}
|
|
27
|
-
|
|
28
30
|
function namespaceToFileName(fileName, opts = {}) {
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
31
|
+
const fileParts = fileName.split('.');
|
|
32
|
+
while (fileParts.length > 0) {
|
|
33
|
+
const file = `${fileParts.join(path_1.default.sep)}.py`;
|
|
34
|
+
if (!opts.checkFile)
|
|
35
|
+
return file;
|
|
36
|
+
if (fs_1.default.existsSync(`${fileParts.join(path_1.default.sep)}.py`)) {
|
|
37
|
+
return file;
|
|
38
|
+
}
|
|
39
|
+
fileParts.pop();
|
|
36
40
|
}
|
|
37
|
-
|
|
38
|
-
}
|
|
39
|
-
return null;
|
|
41
|
+
return null;
|
|
40
42
|
}
|
|
41
|
-
|
|
42
43
|
module.exports = PythonAdapter;
|
|
@@ -1,10 +1,13 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
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
|
+
const adapter_js_1 = __importDefault(require("./adapter.js"));
|
|
7
|
+
class RubyAdapter extends adapter_js_1.default {
|
|
8
|
+
formatStack(t) {
|
|
9
|
+
const stack = super.formatStack(t);
|
|
10
|
+
return stack.replace(/\[(.*?:.\d*)\]/g, '\n$1');
|
|
11
|
+
}
|
|
8
12
|
}
|
|
9
|
-
|
|
10
13
|
module.exports = RubyAdapter;
|
package/lib/output.d.ts
ADDED
package/lib/output.js
CHANGED
|
@@ -1,57 +1,49 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const util_1 = require("util");
|
|
3
4
|
const consoleLog = console.log;
|
|
4
5
|
const consoleError = console.error;
|
|
5
|
-
|
|
6
|
-
const formatArgs = args => format.apply(format, Array.prototype.slice.call(args));
|
|
7
|
-
|
|
6
|
+
const formatArgs = args => util_1.format.apply(util_1.format, Array.prototype.slice.call(args));
|
|
8
7
|
class Output {
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
stop() {
|
|
52
|
-
console.log = consoleLog;
|
|
53
|
-
console.error = consoleError;
|
|
54
|
-
}
|
|
8
|
+
constructor(opts = {}) {
|
|
9
|
+
this.filterFn = opts.filterFn || (() => true);
|
|
10
|
+
this.reset();
|
|
11
|
+
}
|
|
12
|
+
reset() {
|
|
13
|
+
this.log = [];
|
|
14
|
+
this.stop(); // resotre console log if it was overridden
|
|
15
|
+
}
|
|
16
|
+
start() {
|
|
17
|
+
const { filterFn } = this;
|
|
18
|
+
const self = this;
|
|
19
|
+
console.log = (...args) => {
|
|
20
|
+
const obj = {};
|
|
21
|
+
Error.captureStackTrace(obj);
|
|
22
|
+
const logString = formatArgs(args);
|
|
23
|
+
if (filterFn(obj.stack)) {
|
|
24
|
+
self.log.push(logString);
|
|
25
|
+
}
|
|
26
|
+
consoleLog(logString);
|
|
27
|
+
};
|
|
28
|
+
console.error = (...args) => {
|
|
29
|
+
const obj = {};
|
|
30
|
+
Error.captureStackTrace(obj);
|
|
31
|
+
const logString = formatArgs(args);
|
|
32
|
+
if (filterFn(obj.stack)) {
|
|
33
|
+
self.log.push(logString);
|
|
34
|
+
}
|
|
35
|
+
consoleError(logString);
|
|
36
|
+
};
|
|
37
|
+
}
|
|
38
|
+
push(line) {
|
|
39
|
+
this.log.push(line);
|
|
40
|
+
}
|
|
41
|
+
text() {
|
|
42
|
+
return this.log.join('\n');
|
|
43
|
+
}
|
|
44
|
+
stop() {
|
|
45
|
+
console.log = consoleLog;
|
|
46
|
+
console.error = consoleError;
|
|
47
|
+
}
|
|
55
48
|
}
|
|
56
|
-
|
|
57
49
|
module.exports = Output;
|
package/lib/package.json
ADDED
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @class BitbucketPipe
|
|
3
|
+
* @typedef {import('../../types/types.js').Pipe} Pipe
|
|
4
|
+
* @typedef {import('../../types/types.js').TestData} TestData
|
|
5
|
+
*/
|
|
6
|
+
export class BitbucketPipe {
|
|
7
|
+
constructor(params: any, store?: {});
|
|
8
|
+
isEnabled: boolean;
|
|
9
|
+
ENV: NodeJS.ProcessEnv;
|
|
10
|
+
store: {};
|
|
11
|
+
tests: any[];
|
|
12
|
+
token: any;
|
|
13
|
+
hiddenCommentData: string;
|
|
14
|
+
client: Gaxios;
|
|
15
|
+
cleanLog(log: any): Promise<string>;
|
|
16
|
+
prepareRun(): Promise<void>;
|
|
17
|
+
createRun(): Promise<void>;
|
|
18
|
+
addTest(test: any): void;
|
|
19
|
+
finishRun(runParams: any): Promise<void>;
|
|
20
|
+
toString(): string;
|
|
21
|
+
updateRun(): void;
|
|
22
|
+
}
|
|
23
|
+
export type Pipe = import("../../types/types.js").Pipe;
|
|
24
|
+
export type TestData = import("../../types/types.js").TestData;
|
|
25
|
+
import { Gaxios } from 'gaxios';
|