@testomatio/reporter 0.8.0-beta.1 → 0.8.0-beta.3
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/lib/adapter/mocha.js +1 -7
- package/lib/pipe/github.js +3 -4
- package/package.json +4 -3
package/lib/adapter/mocha.js
CHANGED
|
@@ -11,13 +11,7 @@ function MochaReporter(runner, opts) {
|
|
|
11
11
|
let passes = 0;
|
|
12
12
|
let failures = 0;
|
|
13
13
|
|
|
14
|
-
const { apiKey
|
|
15
|
-
|
|
16
|
-
if (!apiKey) {
|
|
17
|
-
console.log('TESTOMATIO key is empty, ignoring reports');
|
|
18
|
-
return;
|
|
19
|
-
}
|
|
20
|
-
const client = new TestomatClient({ apiKey });
|
|
14
|
+
const client = new TestomatClient({ apiKey: opts?.reporterOptions?.apiKey });
|
|
21
15
|
|
|
22
16
|
runner.on(EVENT_RUN_BEGIN, () => {
|
|
23
17
|
client.createRun();
|
package/lib/pipe/github.js
CHANGED
|
@@ -27,7 +27,7 @@ class GitHubPipe {
|
|
|
27
27
|
|
|
28
28
|
addTest(test) {
|
|
29
29
|
if (!this.isEnabled) return;
|
|
30
|
-
|
|
30
|
+
|
|
31
31
|
const index = this.tests.findIndex(t => isSameTest(t, test))
|
|
32
32
|
// update if they were already added
|
|
33
33
|
if (index >= 0) {
|
|
@@ -105,16 +105,15 @@ class GitHubPipe {
|
|
|
105
105
|
let body = summary;
|
|
106
106
|
|
|
107
107
|
if (failures.length) {
|
|
108
|
-
body +=
|
|
109
|
-
|
|
108
|
+
body += `<details>\n<summary>### 🟥 Failures (${failures.length})</summary>\n${failures.join('\n')} </details>`;
|
|
110
109
|
}
|
|
110
|
+
|
|
111
111
|
if (failures.length > 20) {
|
|
112
112
|
body += "\n> Notice\n> Only first 20 failures shown*"
|
|
113
113
|
}
|
|
114
114
|
|
|
115
115
|
if (this.tests.length > 0) {
|
|
116
116
|
body += "\n### 🐢 Slowest Tests\n\n"
|
|
117
|
-
|
|
118
117
|
body += this.tests.sort((a, b) => b?.run_time - a?.run_time).slice(0, 5).map(t => {
|
|
119
118
|
return `* ${fullName(t)} (${parseFloat(t.run_time).toFixed(2)}ms)`
|
|
120
119
|
}).join('\n')
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@testomatio/reporter",
|
|
3
|
-
"version": "0.8.0-beta.
|
|
3
|
+
"version": "0.8.0-beta.3",
|
|
4
4
|
"description": "Testomatio Reporter Client",
|
|
5
5
|
"main": "./lib/reporter.js",
|
|
6
6
|
"repository": "git@github.com:testomatio/reporter.git",
|
|
@@ -19,7 +19,8 @@
|
|
|
19
19
|
"has-flag": "^5.0.1",
|
|
20
20
|
"is-valid-path": "^0.1.1",
|
|
21
21
|
"json-cycle": "^1.3.0",
|
|
22
|
-
"lodash.memoize": "^4.1.2"
|
|
22
|
+
"lodash.memoize": "^4.1.2",
|
|
23
|
+
"lodash.merge": "^4.6.2"
|
|
23
24
|
},
|
|
24
25
|
"files": [
|
|
25
26
|
"bin",
|
|
@@ -30,7 +31,7 @@
|
|
|
30
31
|
"pretty": "prettier --write .",
|
|
31
32
|
"lint": "eslint lib",
|
|
32
33
|
"lint:fix": "eslint lib --fix",
|
|
33
|
-
"test": "mocha tests/**",
|
|
34
|
+
"test": "mocha tests/** -R ./lib/adapter/mocha.js",
|
|
34
35
|
"init": "cd ./tests/adapter/examples/cucumber && npm i",
|
|
35
36
|
"test:unit": "mocha tests",
|
|
36
37
|
"test:adapter": "mocha './tests/adapter/index.test.js'",
|