@testomatio/reporter 0.8.0-beta.10 → 0.8.0-beta.12
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/client.js +0 -2
- package/lib/pipe/github.js +5 -3
- package/package.json +1 -1
package/lib/client.js
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
const axios = require('axios');
|
|
2
1
|
const createCallsiteRecord = require('callsite-record');
|
|
3
2
|
const { sep, join } = require('path');
|
|
4
3
|
const fs = require('fs');
|
|
@@ -23,7 +22,6 @@ class TestomatClient {
|
|
|
23
22
|
const store = {}
|
|
24
23
|
this.pipes = pipesFactory(params, store);
|
|
25
24
|
this.queue = Promise.resolve();
|
|
26
|
-
this.axios = axios.create();
|
|
27
25
|
this.totalUploaded = 0;
|
|
28
26
|
this.version = JSON.parse(fs.readFileSync(join(__dirname, '..', 'package.json')).toString()).version;
|
|
29
27
|
console.log(APP_PREFIX, `Testomatio Reporter v${this.version}`);
|
package/lib/pipe/github.js
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
|
+
const path = require('path');
|
|
1
2
|
const chalk = require('chalk');
|
|
3
|
+
const merge = require('lodash.merge');
|
|
2
4
|
const { Octokit } = require("@octokit/rest");
|
|
3
5
|
const { APP_PREFIX } = require('../constants');
|
|
4
6
|
const { ansiRegExp, isSameTest } = require('../util');
|
|
5
|
-
const merge = require('lodash.merge');
|
|
6
7
|
|
|
7
8
|
|
|
8
9
|
class GitHubPipe {
|
|
@@ -103,8 +104,9 @@ class GitHubPipe {
|
|
|
103
104
|
if (t.stack) text += "```diff\n" + t.stack.replace(ansiRegExp(), '').trim() + "\n```\n";
|
|
104
105
|
|
|
105
106
|
if (t.artifacts && t.artifacts.length && !process.env.TESTOMATIO_PRIVATE_ARTIFACTS) {
|
|
106
|
-
t.artifacts.filter(f => f.endsWith('.png')).forEach(f => {
|
|
107
|
+
t.artifacts.filter(f => !!f).filter(f => f.endsWith('.png')).forEach(f => {
|
|
107
108
|
if (f.endsWith('.png')) return text+= `\n`
|
|
109
|
+
return text+= `[📄 ${path.basename(f)}](${f})\n`
|
|
108
110
|
});
|
|
109
111
|
}
|
|
110
112
|
|
|
@@ -124,7 +126,7 @@ class GitHubPipe {
|
|
|
124
126
|
}
|
|
125
127
|
|
|
126
128
|
if (this.tests.length > 0) {
|
|
127
|
-
body += "
|
|
129
|
+
body += "<details>\n<summary><h3>🐢 Slowest Tests</h3></summary>\n\n"
|
|
128
130
|
body += this.tests.sort((a, b) => b?.run_time - a?.run_time).slice(0, 5).map(t => {
|
|
129
131
|
return `* ${fullName(t)} (${parseFloat(t.run_time).toFixed(2)}ms)`
|
|
130
132
|
}).join('\n')
|