jest-qase-reporter 2.0.4 → 2.1.0
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/README.md +1 -1
- package/changelog.md +7 -0
- package/dist/jest.d.ts +1 -1
- package/dist/jest.js +1 -2
- package/dist/reporter.d.ts +1 -0
- package/dist/reporter.js +4 -1
- package/package.json +2 -2
- package/dist/step.d.ts +0 -16
- package/dist/step.js +0 -88
package/README.md
CHANGED
package/changelog.md
CHANGED
|
@@ -1,3 +1,10 @@
|
|
|
1
|
+
# jest-qase-reporter@2.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
|
+
|
|
1
8
|
# jest-qase-reporter@2.0.4
|
|
2
9
|
|
|
3
10
|
## What's new
|
package/dist/jest.d.ts
CHANGED
package/dist/jest.js
CHANGED
|
@@ -4,7 +4,6 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
exports.qase = void 0;
|
|
7
|
-
const step_1 = require("./step");
|
|
8
7
|
const path_1 = __importDefault(require("path"));
|
|
9
8
|
const qase_javascript_commons_1 = require("qase-javascript-commons");
|
|
10
9
|
const uuid_1 = require("uuid");
|
|
@@ -109,7 +108,7 @@ exports.qase.groupParameters = (values) => {
|
|
|
109
108
|
* });
|
|
110
109
|
*/
|
|
111
110
|
exports.qase.step = async (name, body) => {
|
|
112
|
-
const runningStep = new
|
|
111
|
+
const runningStep = new qase_javascript_commons_1.QaseStep(name);
|
|
113
112
|
// eslint-disable-next-line @typescript-eslint/require-await
|
|
114
113
|
await runningStep.run(body, async (step) => global.Qase.step(step));
|
|
115
114
|
};
|
package/dist/reporter.d.ts
CHANGED
package/dist/reporter.js
CHANGED
|
@@ -70,7 +70,7 @@ class JestQaseReporter {
|
|
|
70
70
|
* @see {Reporter.onRunStart}
|
|
71
71
|
*/
|
|
72
72
|
onRunStart() {
|
|
73
|
-
|
|
73
|
+
this.reporter.startTestRun();
|
|
74
74
|
}
|
|
75
75
|
onTestCaseResult(test, testCaseResult) {
|
|
76
76
|
if (this.metadata.ignore) {
|
|
@@ -288,5 +288,8 @@ class JestQaseReporter {
|
|
|
288
288
|
}
|
|
289
289
|
return title;
|
|
290
290
|
}
|
|
291
|
+
async onRunnerEnd() {
|
|
292
|
+
await this.reporter.publish();
|
|
293
|
+
}
|
|
291
294
|
}
|
|
292
295
|
exports.JestQaseReporter = JestQaseReporter;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "jest-qase-reporter",
|
|
3
|
-
"version": "2.0
|
|
3
|
+
"version": "2.1.0",
|
|
4
4
|
"description": "Qase TMS Jest Reporter",
|
|
5
5
|
"main": "./dist/index.js",
|
|
6
6
|
"types": "./dist/index.d.ts",
|
|
@@ -45,7 +45,7 @@
|
|
|
45
45
|
"dependencies": {
|
|
46
46
|
"lodash.get": "^4.4.2",
|
|
47
47
|
"lodash.has": "^4.5.2",
|
|
48
|
-
"qase-javascript-commons": "~2.
|
|
48
|
+
"qase-javascript-commons": "~2.3.0",
|
|
49
49
|
"uuid": "^9.0.0"
|
|
50
50
|
},
|
|
51
51
|
"devDependencies": {
|
package/dist/step.d.ts
DELETED
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import { Attachment, TestStepType } from 'qase-javascript-commons';
|
|
2
|
-
export type StepFunction<T = any> = (this: QaseStep, step: QaseStep) => T | Promise<T>;
|
|
3
|
-
export declare class QaseStep {
|
|
4
|
-
name: string;
|
|
5
|
-
attachments: Attachment[];
|
|
6
|
-
steps: TestStepType[];
|
|
7
|
-
constructor(name: string);
|
|
8
|
-
attach(attach: {
|
|
9
|
-
name?: string;
|
|
10
|
-
type?: string;
|
|
11
|
-
content?: string;
|
|
12
|
-
paths?: string[] | string;
|
|
13
|
-
}): void;
|
|
14
|
-
step(name: string, body: StepFunction): Promise<void>;
|
|
15
|
-
run(body: StepFunction, messageEmitter: (step: TestStepType) => Promise<void>): Promise<void>;
|
|
16
|
-
}
|
package/dist/step.js
DELETED
|
@@ -1,88 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.QaseStep = void 0;
|
|
7
|
-
const qase_javascript_commons_1 = require("qase-javascript-commons");
|
|
8
|
-
const uuid_1 = require("uuid");
|
|
9
|
-
const path_1 = __importDefault(require("path"));
|
|
10
|
-
// TODO: Move to common, because it's duplicated in qase-wdio/src/step.ts
|
|
11
|
-
class QaseStep {
|
|
12
|
-
name = '';
|
|
13
|
-
attachments = [];
|
|
14
|
-
steps = [];
|
|
15
|
-
constructor(name) {
|
|
16
|
-
this.name = name;
|
|
17
|
-
}
|
|
18
|
-
attach(attach) {
|
|
19
|
-
if (attach.paths) {
|
|
20
|
-
const files = Array.isArray(attach.paths) ? attach.paths : [attach.paths];
|
|
21
|
-
for (const file of files) {
|
|
22
|
-
const attachmentName = path_1.default.basename(file);
|
|
23
|
-
const contentType = 'application/octet-stream';
|
|
24
|
-
this.attachments.push({
|
|
25
|
-
id: (0, uuid_1.v4)(),
|
|
26
|
-
file_name: attachmentName,
|
|
27
|
-
mime_type: contentType,
|
|
28
|
-
content: '',
|
|
29
|
-
file_path: file,
|
|
30
|
-
size: 0,
|
|
31
|
-
});
|
|
32
|
-
}
|
|
33
|
-
return;
|
|
34
|
-
}
|
|
35
|
-
if (attach.content) {
|
|
36
|
-
const attachmentName = attach.name ?? 'attachment';
|
|
37
|
-
const contentType = attach.type ?? 'application/octet-stream';
|
|
38
|
-
this.attachments.push({
|
|
39
|
-
id: (0, uuid_1.v4)(),
|
|
40
|
-
file_name: attachmentName,
|
|
41
|
-
mime_type: contentType,
|
|
42
|
-
content: attach.content,
|
|
43
|
-
file_path: null,
|
|
44
|
-
size: attach.content.length,
|
|
45
|
-
});
|
|
46
|
-
}
|
|
47
|
-
}
|
|
48
|
-
async step(name, body) {
|
|
49
|
-
const childStep = new QaseStep(name);
|
|
50
|
-
// eslint-disable-next-line @typescript-eslint/require-await
|
|
51
|
-
await childStep.run(body, async (step) => {
|
|
52
|
-
this.steps.push(step);
|
|
53
|
-
});
|
|
54
|
-
}
|
|
55
|
-
async run(body, messageEmitter) {
|
|
56
|
-
const startDate = new Date().getTime();
|
|
57
|
-
const step = new qase_javascript_commons_1.TestStepType();
|
|
58
|
-
step.data = {
|
|
59
|
-
action: this.name,
|
|
60
|
-
expected_result: null,
|
|
61
|
-
};
|
|
62
|
-
try {
|
|
63
|
-
await body.call(this, this);
|
|
64
|
-
step.execution = {
|
|
65
|
-
start_time: startDate,
|
|
66
|
-
end_time: new Date().getTime(),
|
|
67
|
-
status: qase_javascript_commons_1.StepStatusEnum.passed,
|
|
68
|
-
duration: null,
|
|
69
|
-
};
|
|
70
|
-
step.attachments = this.attachments;
|
|
71
|
-
step.steps = this.steps;
|
|
72
|
-
await messageEmitter(step);
|
|
73
|
-
}
|
|
74
|
-
catch (e) {
|
|
75
|
-
step.execution = {
|
|
76
|
-
start_time: startDate,
|
|
77
|
-
end_time: new Date().getTime(),
|
|
78
|
-
status: qase_javascript_commons_1.StepStatusEnum.failed,
|
|
79
|
-
duration: null,
|
|
80
|
-
};
|
|
81
|
-
step.attachments = this.attachments;
|
|
82
|
-
step.steps = this.steps;
|
|
83
|
-
await messageEmitter(step);
|
|
84
|
-
throw e;
|
|
85
|
-
}
|
|
86
|
-
}
|
|
87
|
-
}
|
|
88
|
-
exports.QaseStep = QaseStep;
|