jest-qase-reporter 1.3.1 → 2.0.0-beta.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/README.md +36 -27
- package/dist/index.d.ts +2 -39
- package/dist/index.js +2 -433
- package/dist/jest.d.ts +1 -4
- package/dist/jest.js +6 -13
- package/dist/reporter.d.ts +53 -0
- package/dist/reporter.js +98 -0
- package/package.json +42 -33
- package/tsconfig.build.json +9 -0
- package/dist/index.js.map +0 -1
- package/dist/jest.js.map +0 -1
- package/examples/package-lock.json +0 -3054
- package/examples/package.json +0 -17
- package/examples/test/arith.js +0 -6
- package/examples/test/arith.test.js +0 -75
- package/test/plugin.test.ts +0 -144
- /package/{examples/screenshots → screenshots}/screenshot.png +0 -0
package/examples/package.json
DELETED
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "examples",
|
|
3
|
-
"version": "1.0.0",
|
|
4
|
-
"description": "",
|
|
5
|
-
"main": "index.js",
|
|
6
|
-
"scripts": {
|
|
7
|
-
"test": "QASE_REPORT=1 npx jest"
|
|
8
|
-
},
|
|
9
|
-
"author": "",
|
|
10
|
-
"license": "ISC",
|
|
11
|
-
"devDependencies": {
|
|
12
|
-
"jest": "^27.0.4"
|
|
13
|
-
},
|
|
14
|
-
"dependencies": {
|
|
15
|
-
"jest-qase-reporter": "../"
|
|
16
|
-
}
|
|
17
|
-
}
|
package/examples/test/arith.js
DELETED
|
@@ -1,75 +0,0 @@
|
|
|
1
|
-
const { add, mul, sub, div } = require('./arith');
|
|
2
|
-
const { qase } = require('jest-qase-reporter/dist/jest');
|
|
3
|
-
|
|
4
|
-
describe("Test suite", () => {
|
|
5
|
-
test('2 + 3 = 5 without qase wrapper', () => {
|
|
6
|
-
expect(add(2, 3)).toBe(5);
|
|
7
|
-
});
|
|
8
|
-
|
|
9
|
-
test.skip('2 + 3 = 5 skipped', () => {
|
|
10
|
-
expect(add(2, 3)).toBe(5);
|
|
11
|
-
});
|
|
12
|
-
|
|
13
|
-
test('2 + 3 = 6', () => {
|
|
14
|
-
expect(add(2, 3)).toBe(6);
|
|
15
|
-
});
|
|
16
|
-
|
|
17
|
-
describe('Suite for the some nested cases', () => {
|
|
18
|
-
test('Nested 1', () => {
|
|
19
|
-
expect(add(2, 3)).toBe(5);
|
|
20
|
-
});
|
|
21
|
-
|
|
22
|
-
test.skip('2 + 3 = 5 skipped', () => {
|
|
23
|
-
expect(add(2, 3)).toBe(5);
|
|
24
|
-
});
|
|
25
|
-
|
|
26
|
-
test('2 + 3 = 6 Wrong case', () => {
|
|
27
|
-
expect(add(2, 3)).toBe(6);
|
|
28
|
-
});
|
|
29
|
-
|
|
30
|
-
test('Async test case', async () => {
|
|
31
|
-
await new Promise((r) => setTimeout(r, 2000));
|
|
32
|
-
expect(mul(3, 4)).toBe(12);
|
|
33
|
-
});
|
|
34
|
-
})
|
|
35
|
-
|
|
36
|
-
describe("Test suite", () => {
|
|
37
|
-
|
|
38
|
-
for (let i = 0; i <= 100; i++) {
|
|
39
|
-
test(`${i} + ${i} autogenerated case`, () => {
|
|
40
|
-
expect(add(i, i)).toBe(i * 2);
|
|
41
|
-
});
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
test('2 + 3 = 5 without qase wrapper', () => {
|
|
45
|
-
expect(add(2, 3)).toBe(5);
|
|
46
|
-
});
|
|
47
|
-
|
|
48
|
-
test.skip('2 + 3 = 5 skipped', () => {
|
|
49
|
-
expect(add(2, 3)).toBe(5);
|
|
50
|
-
});
|
|
51
|
-
|
|
52
|
-
test('2 + 3 = 6', () => {
|
|
53
|
-
expect(add(2, 3)).toBe(6);
|
|
54
|
-
});
|
|
55
|
-
|
|
56
|
-
describe('Suite for the some nested cases', () => {
|
|
57
|
-
test('Nested 1', () => {
|
|
58
|
-
expect(add(2, 3)).toBe(5);
|
|
59
|
-
});
|
|
60
|
-
|
|
61
|
-
test.skip('2 + 3 = 5 skipped', () => {
|
|
62
|
-
expect(add(2, 3)).toBe(5);
|
|
63
|
-
});
|
|
64
|
-
|
|
65
|
-
test('2 + 3 = 6 Wrong case', () => {
|
|
66
|
-
expect(add(2, 3)).toBe(6);
|
|
67
|
-
});
|
|
68
|
-
|
|
69
|
-
test('Async test case', async () => {
|
|
70
|
-
await new Promise((r) => setTimeout(r, 2000));
|
|
71
|
-
expect(mul(3, 4)).toBe(12);
|
|
72
|
-
});
|
|
73
|
-
})
|
|
74
|
-
})
|
|
75
|
-
})
|
package/test/plugin.test.ts
DELETED
|
@@ -1,144 +0,0 @@
|
|
|
1
|
-
import { describe, expect, it } from '@jest/globals';
|
|
2
|
-
import QaseReporter from '../src';
|
|
3
|
-
|
|
4
|
-
describe('Client', () => {
|
|
5
|
-
it('Init client', () => {
|
|
6
|
-
const options = { apiToken: "", projectCode: "" };
|
|
7
|
-
new QaseReporter({}, options);
|
|
8
|
-
});
|
|
9
|
-
|
|
10
|
-
describe('Auto Create Defect', () => {
|
|
11
|
-
const options = { apiToken: "", projectCode: "" };
|
|
12
|
-
describe('known test cases', () => {
|
|
13
|
-
const qReporter = new QaseReporter({}, options);
|
|
14
|
-
const testData = [
|
|
15
|
-
{
|
|
16
|
-
test: {
|
|
17
|
-
duration: 0,
|
|
18
|
-
status: 'failed',
|
|
19
|
-
title: 'Test (Qase ID: 1)',
|
|
20
|
-
failureMessages: ['failure message'],
|
|
21
|
-
ancestorTitles: ['some ancestor', "path"]
|
|
22
|
-
},
|
|
23
|
-
defect: true,
|
|
24
|
-
},
|
|
25
|
-
{
|
|
26
|
-
test: {
|
|
27
|
-
duration: 0,
|
|
28
|
-
status: 'passed',
|
|
29
|
-
title: 'Test (Qase ID: 2)',
|
|
30
|
-
failureMessages: [],
|
|
31
|
-
ancestorTitles: ['some ancestor 2', "path"]
|
|
32
|
-
},
|
|
33
|
-
defect: false,
|
|
34
|
-
},
|
|
35
|
-
{
|
|
36
|
-
test: {
|
|
37
|
-
duration: 0,
|
|
38
|
-
status: 'skipped',
|
|
39
|
-
title: 'Test (Qase ID: 3)',
|
|
40
|
-
failureMessages: [],
|
|
41
|
-
ancestorTitles: ['some ancestor 3', "path"]
|
|
42
|
-
},
|
|
43
|
-
defect: false,
|
|
44
|
-
},
|
|
45
|
-
{
|
|
46
|
-
test: {
|
|
47
|
-
duration: 0,
|
|
48
|
-
status: 'pending',
|
|
49
|
-
title: 'Test (Qase ID: 4)',
|
|
50
|
-
failureMessages: [],
|
|
51
|
-
ancestorTitles: ['some ancestor 4', "path"]
|
|
52
|
-
},
|
|
53
|
-
defect: false,
|
|
54
|
-
},
|
|
55
|
-
{
|
|
56
|
-
test: {
|
|
57
|
-
duration: 0,
|
|
58
|
-
status: 'disabled',
|
|
59
|
-
title: 'Test (Qase ID: 5)',
|
|
60
|
-
failureMessages: [],
|
|
61
|
-
ancestorTitles: ['some ancestor 5', "path"]
|
|
62
|
-
},
|
|
63
|
-
defect: false,
|
|
64
|
-
},
|
|
65
|
-
]
|
|
66
|
-
qReporter['preparedTestCases'] = qReporter['createPreparedForPublishTestsArray'](testData.map(td => td.test) as any);
|
|
67
|
-
const testResultsForPublishing = qReporter['createResultCasesArray']();
|
|
68
|
-
|
|
69
|
-
for (const index in testData) {
|
|
70
|
-
const status = testData[index].test.status;
|
|
71
|
-
const defect = testData[index].defect;
|
|
72
|
-
it(`should set defect=${defect} when status=${status}`, () => {
|
|
73
|
-
expect(testResultsForPublishing[index].defect).toBe(defect);
|
|
74
|
-
});
|
|
75
|
-
};
|
|
76
|
-
});
|
|
77
|
-
|
|
78
|
-
describe('unknown test cases', () => {
|
|
79
|
-
const qReporter = new QaseReporter({}, options);
|
|
80
|
-
const testData = [
|
|
81
|
-
{
|
|
82
|
-
test: {
|
|
83
|
-
duration: 0,
|
|
84
|
-
status: 'failed',
|
|
85
|
-
title: 'Test 1',
|
|
86
|
-
failureMessages: ['failure message'],
|
|
87
|
-
ancestorTitles: ['some ancestor', "path"]
|
|
88
|
-
},
|
|
89
|
-
defect: true,
|
|
90
|
-
},
|
|
91
|
-
{
|
|
92
|
-
test: {
|
|
93
|
-
duration: 0,
|
|
94
|
-
status: 'passed',
|
|
95
|
-
title: 'Test 2',
|
|
96
|
-
failureMessages: [],
|
|
97
|
-
ancestorTitles: ['some ancestor 2', "path"]
|
|
98
|
-
},
|
|
99
|
-
defect: false,
|
|
100
|
-
},
|
|
101
|
-
{
|
|
102
|
-
test: {
|
|
103
|
-
duration: 0,
|
|
104
|
-
status: 'skipped',
|
|
105
|
-
title: 'Test 3',
|
|
106
|
-
failureMessages: [],
|
|
107
|
-
ancestorTitles: ['some ancestor 3', "path"]
|
|
108
|
-
},
|
|
109
|
-
defect: false,
|
|
110
|
-
},
|
|
111
|
-
{
|
|
112
|
-
test: {
|
|
113
|
-
duration: 0,
|
|
114
|
-
status: 'pending',
|
|
115
|
-
title: 'Test 4',
|
|
116
|
-
failureMessages: [],
|
|
117
|
-
ancestorTitles: ['some ancestor 4', "path"]
|
|
118
|
-
},
|
|
119
|
-
defect: false,
|
|
120
|
-
},
|
|
121
|
-
{
|
|
122
|
-
test: {
|
|
123
|
-
duration: 0,
|
|
124
|
-
status: 'disabled',
|
|
125
|
-
title: 'Test 5',
|
|
126
|
-
failureMessages: [],
|
|
127
|
-
ancestorTitles: ['some ancestor 5', "path"]
|
|
128
|
-
},
|
|
129
|
-
defect: false,
|
|
130
|
-
},
|
|
131
|
-
]
|
|
132
|
-
qReporter['preparedTestCases'] = qReporter['createPreparedForPublishTestsArray'](testData.map(td => td.test) as any);
|
|
133
|
-
const testResultsForPublishing = qReporter['createResultCasesArray']();
|
|
134
|
-
|
|
135
|
-
for (const index in testData) {
|
|
136
|
-
const status = testData[index].test.status;
|
|
137
|
-
const defect = testData[index].defect;
|
|
138
|
-
it(`should set defect=${defect} when status=${status}`, () => {
|
|
139
|
-
expect(testResultsForPublishing[index].defect).toBe(defect);
|
|
140
|
-
});
|
|
141
|
-
};
|
|
142
|
-
});
|
|
143
|
-
});
|
|
144
|
-
});
|
|
File without changes
|