@testomatio/reporter 0.4.5 → 0.4.6
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/Changelog.md +4 -0
- package/lib/adapter/codecept.js +11 -4
- package/lib/client.js +1 -0
- package/package.json +1 -1
package/Changelog.md
CHANGED
package/lib/adapter/codecept.js
CHANGED
|
@@ -11,6 +11,7 @@ const upload = require("../fileUploader");
|
|
|
11
11
|
const Output = require("../output");
|
|
12
12
|
|
|
13
13
|
let currentMetaStep = [];
|
|
14
|
+
let error;
|
|
14
15
|
let stepShift = 0;
|
|
15
16
|
const output = new Output({
|
|
16
17
|
filterFn: (stack) => !stack.includes("codeceptjs/lib/output"), // output from codeceptjs
|
|
@@ -85,6 +86,7 @@ module.exports = (config) => {
|
|
|
85
86
|
|
|
86
87
|
event.dispatcher.on(event.test.started, (test) => {
|
|
87
88
|
testTimeMap[test.id] = Date.now();
|
|
89
|
+
err = null;
|
|
88
90
|
});
|
|
89
91
|
|
|
90
92
|
event.dispatcher.on(event.all.result, async () => {
|
|
@@ -123,14 +125,19 @@ module.exports = (config) => {
|
|
|
123
125
|
output.stop();
|
|
124
126
|
});
|
|
125
127
|
|
|
128
|
+
event.dispatcher.on(event.test.failed, (test, err) => {
|
|
129
|
+
error = err;
|
|
130
|
+
});
|
|
131
|
+
|
|
126
132
|
event.dispatcher.on(event.test.after, (test) => {
|
|
127
133
|
if (test.state && test.state !== FAILED) return;
|
|
128
|
-
|
|
134
|
+
if (test.err) error = test.err;
|
|
135
|
+
const { id, tags, title, artifacts } = test;
|
|
129
136
|
failedTests.push(id || title);
|
|
130
137
|
const testId = parseTest(tags);
|
|
131
138
|
const testObj = getTestAndMessage(title);
|
|
132
|
-
if (
|
|
133
|
-
|
|
139
|
+
if (error && error.stack && test.steps && test.steps.length) {
|
|
140
|
+
error.stack = test.steps[test.steps.length - 1].line();
|
|
134
141
|
}
|
|
135
142
|
|
|
136
143
|
const files = [];
|
|
@@ -140,7 +147,7 @@ module.exports = (config) => {
|
|
|
140
147
|
|
|
141
148
|
client.addTestRun(testId, TRConstants.FAILED, {
|
|
142
149
|
...stripExampleFromTitle(title),
|
|
143
|
-
error
|
|
150
|
+
error,
|
|
144
151
|
message: testObj.message,
|
|
145
152
|
time: getDuration(test),
|
|
146
153
|
files,
|
package/lib/client.js
CHANGED