mocha-qase-reporter 1.0.2 → 1.1.1
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 +8 -0
- package/dist/interceptor.js +1 -0
- package/dist/parallel.js +1 -1
- package/dist/reporter.js +12 -15
- package/package.json +2 -2
package/changelog.md
CHANGED
|
@@ -1,3 +1,11 @@
|
|
|
1
|
+
# qase-mocha@1.1.0
|
|
2
|
+
|
|
3
|
+
## What's new
|
|
4
|
+
|
|
5
|
+
- Updated to the latest minor version of the common package for improved compatibility and features.
|
|
6
|
+
- Fixed all ESLint warnings across the project to ensure code quality and maintainability.
|
|
7
|
+
- Resolved an issue that prevented proper execution of async tests
|
|
8
|
+
|
|
1
9
|
# qase-mocha@1.0.2
|
|
2
10
|
|
|
3
11
|
## What's new
|
package/dist/interceptor.js
CHANGED
|
@@ -8,6 +8,7 @@ class StreamInterceptor extends stream_1.Writable {
|
|
|
8
8
|
super();
|
|
9
9
|
this.onWrite = onWriteCallback;
|
|
10
10
|
}
|
|
11
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
11
12
|
_write(chunk, _encoding, callback) {
|
|
12
13
|
// eslint-disable-next-line @typescript-eslint/no-unsafe-member-access,@typescript-eslint/no-unsafe-argument,@typescript-eslint/no-unsafe-call
|
|
13
14
|
this.onWrite(chunk.toString());
|
package/dist/parallel.js
CHANGED
|
@@ -4,7 +4,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
7
|
-
// @ts-
|
|
7
|
+
// @ts-expect-error
|
|
8
8
|
const parallel_buffered_js_1 = __importDefault(require("mocha/lib/nodejs/reporters/parallel-buffered.js"));
|
|
9
9
|
const reporter_js_1 = require("./reporter.js");
|
|
10
10
|
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
|
package/dist/reporter.js
CHANGED
|
@@ -74,7 +74,7 @@ class MochaQaseReporter extends mocha_1.reporters.Base {
|
|
|
74
74
|
this.runner.on(Events.EVENT_TEST_END, (test) => this.onEndTest(test));
|
|
75
75
|
};
|
|
76
76
|
onStartRun() {
|
|
77
|
-
this.reporter.
|
|
77
|
+
(0, deasync_promise_1.default)(this.reporter.startTestRunAsync());
|
|
78
78
|
}
|
|
79
79
|
onEndRun() {
|
|
80
80
|
(0, deasync_promise_1.default)(this.reporter.publish());
|
|
@@ -105,10 +105,10 @@ class MochaQaseReporter extends mocha_1.reporters.Base {
|
|
|
105
105
|
this.testOutputs.set(test.title, output);
|
|
106
106
|
});
|
|
107
107
|
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
108
|
-
// @ts-
|
|
108
|
+
// @ts-expect-error
|
|
109
109
|
process.stdout.write = stdoutInterceptor.write.bind(stdoutInterceptor);
|
|
110
110
|
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
111
|
-
// @ts-
|
|
111
|
+
// @ts-expect-error
|
|
112
112
|
process.stderr.write = stderrInterceptor.write.bind(stderrInterceptor);
|
|
113
113
|
this.testOutputs.set(test.title, { stdout: '', stderr: '' });
|
|
114
114
|
this.addMethodsToContext(test.ctx);
|
|
@@ -170,7 +170,7 @@ class MochaQaseReporter extends mocha_1.reporters.Base {
|
|
|
170
170
|
group_params: this.metadata.groupParameters ?? {},
|
|
171
171
|
relations: relations,
|
|
172
172
|
run_id: null,
|
|
173
|
-
signature: this.getSignature(test, ids),
|
|
173
|
+
signature: this.getSignature(test, ids, this.metadata.parameters ?? {}),
|
|
174
174
|
steps: this.currentTest.steps,
|
|
175
175
|
id: (0, uuid_1.v4)(),
|
|
176
176
|
execution: {
|
|
@@ -186,7 +186,7 @@ class MochaQaseReporter extends mocha_1.reporters.Base {
|
|
|
186
186
|
testops_id: ids.length > 0 ? ids : null,
|
|
187
187
|
title: this.metadata.title && this.metadata.title != '' ? this.metadata.title : this.removeQaseIdsFromTitle(test.title),
|
|
188
188
|
};
|
|
189
|
-
|
|
189
|
+
void this.reporter.addTestResult(result);
|
|
190
190
|
this.metadata.clear();
|
|
191
191
|
this.currentTest = new currentTest();
|
|
192
192
|
}
|
|
@@ -195,24 +195,21 @@ class MochaQaseReporter extends mocha_1.reporters.Base {
|
|
|
195
195
|
* @param {number[]} ids
|
|
196
196
|
* @private
|
|
197
197
|
*/
|
|
198
|
-
getSignature(test, ids) {
|
|
199
|
-
|
|
198
|
+
getSignature(test, ids, params) {
|
|
199
|
+
const suites = [];
|
|
200
200
|
const file = test.parent ? this.getFile(test.parent) : undefined;
|
|
201
201
|
if (file) {
|
|
202
202
|
const executionPath = process.cwd() + '/';
|
|
203
|
-
const path = file.replace(executionPath, '')
|
|
204
|
-
|
|
203
|
+
const path = file.replace(executionPath, '');
|
|
204
|
+
suites.push(path.split('/').join('::'));
|
|
205
205
|
}
|
|
206
206
|
if (test.parent) {
|
|
207
207
|
for (const suite of test.parent.titlePath()) {
|
|
208
|
-
|
|
208
|
+
suites.push(suite.toLowerCase().replace(/\s/g, '_'));
|
|
209
209
|
}
|
|
210
210
|
}
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
signature += '::' + ids.join('::');
|
|
214
|
-
}
|
|
215
|
-
return signature;
|
|
211
|
+
suites.push(test.title.toLowerCase().replace(/\s/g, '_'));
|
|
212
|
+
return (0, qase_javascript_commons_1.generateSignature)(ids, suites, params);
|
|
216
213
|
}
|
|
217
214
|
/**
|
|
218
215
|
* @param {Suite} suite
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "mocha-qase-reporter",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.1.1",
|
|
4
4
|
"description": "Mocha Cypress Reporter",
|
|
5
5
|
"homepage": "https://github.com/qase-tms/qase-javascript",
|
|
6
6
|
"sideEffects": false,
|
|
@@ -43,7 +43,7 @@
|
|
|
43
43
|
"dependencies": {
|
|
44
44
|
"mocha": "^10.2.0",
|
|
45
45
|
"deasync-promise": "^1.0.1",
|
|
46
|
-
"qase-javascript-commons": "~2.
|
|
46
|
+
"qase-javascript-commons": "~2.3.3",
|
|
47
47
|
"uuid": "^9.0.1"
|
|
48
48
|
},
|
|
49
49
|
"devDependencies": {
|