mocha-qase-reporter 1.0.0 → 1.0.2
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 +7 -1
- package/dist/reporter.d.ts +1 -0
- package/dist/reporter.js +8 -3
- package/package.json +2 -2
package/changelog.md
CHANGED
|
@@ -1,8 +1,14 @@
|
|
|
1
|
+
# qase-mocha@1.0.2
|
|
2
|
+
|
|
3
|
+
## What's new
|
|
4
|
+
|
|
5
|
+
Enhanced handling of start and end times for tests and steps, ensuring greater accuracy in reporting.
|
|
6
|
+
|
|
1
7
|
# qase-mocha@1.0.0
|
|
2
8
|
|
|
3
9
|
## What's new
|
|
4
10
|
|
|
5
|
-
Major release of the
|
|
11
|
+
Major release of the Mocha reporter package
|
|
6
12
|
|
|
7
13
|
# qase-mocha@1.0.0-beta.5
|
|
8
14
|
|
package/dist/reporter.d.ts
CHANGED
|
@@ -21,6 +21,7 @@ export declare class MochaQaseReporter extends reporters.Base {
|
|
|
21
21
|
*/
|
|
22
22
|
private readonly metadata;
|
|
23
23
|
private currentTest;
|
|
24
|
+
private testBeginTime;
|
|
24
25
|
private currentType;
|
|
25
26
|
constructor(runner: Runner, options: MochaOptions, configLoader?: ConfigLoader<Partial<import("qase-javascript-commons").ConfigType> & Record<string, unknown>>);
|
|
26
27
|
private applyListeners;
|
package/dist/reporter.js
CHANGED
|
@@ -42,6 +42,7 @@ class MochaQaseReporter extends mocha_1.reporters.Base {
|
|
|
42
42
|
*/
|
|
43
43
|
metadata = new types_1.Metadata();
|
|
44
44
|
currentTest = new currentTest();
|
|
45
|
+
testBeginTime = Date.now();
|
|
45
46
|
currentType = 'test';
|
|
46
47
|
constructor(runner, options, configLoader = new qase_javascript_commons_1.ConfigLoader()) {
|
|
47
48
|
super(runner, options);
|
|
@@ -114,8 +115,11 @@ class MochaQaseReporter extends mocha_1.reporters.Base {
|
|
|
114
115
|
}
|
|
115
116
|
onStartTest() {
|
|
116
117
|
this.currentType = 'test';
|
|
118
|
+
this.testBeginTime = Date.now();
|
|
117
119
|
}
|
|
118
120
|
onEndTest(test) {
|
|
121
|
+
const end_time = Date.now();
|
|
122
|
+
const duration = test.duration ?? end_time - this.testBeginTime;
|
|
119
123
|
process.stdout.write = this.originalStdoutWrite;
|
|
120
124
|
process.stderr.write = this.originalStderrWrite;
|
|
121
125
|
if (this.reporter.isCaptureLogs()) {
|
|
@@ -173,9 +177,9 @@ class MochaQaseReporter extends mocha_1.reporters.Base {
|
|
|
173
177
|
status: test.state
|
|
174
178
|
? MochaQaseReporter.statusMap[test.state]
|
|
175
179
|
: qase_javascript_commons_1.TestStatusEnum.invalid,
|
|
176
|
-
start_time:
|
|
177
|
-
end_time:
|
|
178
|
-
duration:
|
|
180
|
+
start_time: this.testBeginTime / 1000,
|
|
181
|
+
end_time: end_time / 1000,
|
|
182
|
+
duration: duration,
|
|
179
183
|
stacktrace: test.err?.stack ?? null,
|
|
180
184
|
thread: null,
|
|
181
185
|
},
|
|
@@ -295,6 +299,7 @@ class MochaQaseReporter extends mocha_1.reporters.Base {
|
|
|
295
299
|
data: {
|
|
296
300
|
action: title,
|
|
297
301
|
expected_result: null,
|
|
302
|
+
data: null,
|
|
298
303
|
},
|
|
299
304
|
execution: {
|
|
300
305
|
start_time: Date.now(),
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "mocha-qase-reporter",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.2",
|
|
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.2.
|
|
46
|
+
"qase-javascript-commons": "~2.2.14",
|
|
47
47
|
"uuid": "^9.0.1"
|
|
48
48
|
},
|
|
49
49
|
"devDependencies": {
|