jest-qase-reporter 1.3.0-alpha.4 → 2.0.0-beta.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 +48 -43
- package/package.json +42 -33
- package/tsconfig.build.json +9 -0
- package/dist/index.d.ts +0 -39
- package/dist/index.js +0 -433
- package/dist/index.js.map +0 -1
- package/dist/jest.d.ts +0 -4
- package/dist/jest.js +0 -15
- package/dist/jest.js.map +0 -1
- package/examples/package-lock.json +0 -3032
- 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 -9
- /package/{examples/screenshots → screenshots}/screenshot.png +0 -0
package/README.md
CHANGED
|
@@ -17,7 +17,7 @@ But if necessary, you can independently register the ID of already
|
|
|
17
17
|
existing test cases from TMS before the executing tests. For example:
|
|
18
18
|
|
|
19
19
|
```typescript
|
|
20
|
-
import { qase } from 'jest-qase-reporter/
|
|
20
|
+
import { qase } from 'jest-qase-reporter/jest';
|
|
21
21
|
|
|
22
22
|
describe('My First Test', () => {
|
|
23
23
|
test(qase([1,2], 'Several ids'), () => {
|
|
@@ -37,29 +37,21 @@ describe('My First Test', () => {
|
|
|
37
37
|
})
|
|
38
38
|
});
|
|
39
39
|
```
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
40
|
+
To run tests and create a test run, execute the command (for example from folder examples):
|
|
41
|
+
```bash
|
|
42
|
+
QASE_MODE=testops npx jest
|
|
43
43
|
```
|
|
44
|
-
|
|
44
|
+
or
|
|
45
|
+
```bash
|
|
46
|
+
npm test
|
|
45
47
|
```
|
|
46
48
|
|
|
47
|
-
|
|
49
|
+
<p align="center">
|
|
50
|
+
<img width="65%" src="./screenshots/screenshot.png">
|
|
51
|
+
</p>
|
|
48
52
|
|
|
49
|
-
```
|
|
50
|
-
Auto create test cases
|
|
51
|
-
```
|
|
52
|
-
and
|
|
53
|
-
```
|
|
54
|
-
Allow submitting results in bulk
|
|
55
|
-
```
|
|
56
|
-
|
|
57
|
-
To run tests and create a test run, execute the command:
|
|
58
|
-
```bash
|
|
59
|
-
QASE_REPORT=1 npx jest
|
|
60
|
-
```
|
|
61
|
-

|
|
62
53
|
A test run will be performed and available at:
|
|
54
|
+
|
|
63
55
|
```
|
|
64
56
|
https://app.qase.io/run/QASE_PROJECT_CODE
|
|
65
57
|
```
|
|
@@ -68,15 +60,18 @@ https://app.qase.io/run/QASE_PROJECT_CODE
|
|
|
68
60
|
|
|
69
61
|
Reporter options (* - required):
|
|
70
62
|
|
|
71
|
-
-
|
|
63
|
+
- `mode` - `testops`/`off` Enables reporter, default - `off`
|
|
64
|
+
- `debug` - Enables debug logging, defaule - `false`
|
|
65
|
+
- `environment` - To execute with the sending of the envinroment information
|
|
66
|
+
- *`testops.api.token` - Token for API access, you can find more information
|
|
72
67
|
[here](https://developers.qase.io/#authentication)
|
|
73
|
-
- *`
|
|
74
|
-
page of your project: `https://app.qase.io/project/DEMOTR` -
|
|
68
|
+
- *`testops.project` - Code of your project (can be extracted from main
|
|
69
|
+
page of your project: `https://app.qase.io/project/DEMOTR` -
|
|
75
70
|
`DEMOTR` is project code here)
|
|
76
|
-
- `
|
|
77
|
-
- `
|
|
78
|
-
- `
|
|
79
|
-
- `
|
|
71
|
+
- `testops.run.id` - Pass Run ID
|
|
72
|
+
- `testops.run.title` - Set custom Run name, when new run is created
|
|
73
|
+
- `testops.run.description` - Set custom Run description, when new run is created
|
|
74
|
+
- `testops.run.complete` - Whether the run should be completed
|
|
80
75
|
|
|
81
76
|
Example `jest.config.js` config:
|
|
82
77
|
|
|
@@ -87,12 +82,18 @@ module.exports = {
|
|
|
87
82
|
[
|
|
88
83
|
'jest-qase-reporter',
|
|
89
84
|
{
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
85
|
+
debug: true,
|
|
86
|
+
environment: 1,
|
|
87
|
+
testops: {
|
|
88
|
+
api: {
|
|
89
|
+
token: 'api_key'
|
|
90
|
+
},
|
|
91
|
+
project: 'project_code',
|
|
92
|
+
run: {
|
|
93
|
+
id: 45,
|
|
94
|
+
complete: true,
|
|
95
|
+
},
|
|
96
|
+
},
|
|
96
97
|
},
|
|
97
98
|
],
|
|
98
99
|
],
|
|
@@ -100,20 +101,24 @@ module.exports = {
|
|
|
100
101
|
};
|
|
101
102
|
```
|
|
102
103
|
|
|
103
|
-
You can check example configuration with multiple reporters in [example project](
|
|
104
|
+
You can check example configuration with multiple reporters in [example project](../examples/jest/jest.config.js).
|
|
104
105
|
|
|
105
106
|
Supported ENV variables:
|
|
106
107
|
|
|
107
|
-
- `
|
|
108
|
-
|
|
109
|
-
- `
|
|
110
|
-
- `
|
|
111
|
-
- `
|
|
112
|
-
- `
|
|
113
|
-
- `
|
|
114
|
-
- `
|
|
115
|
-
|
|
116
|
-
|
|
108
|
+
- `QASE_MODE` - Same as `mode`
|
|
109
|
+
- `QASE_DEBUG` - Same as `debug`
|
|
110
|
+
- `QASE_ENVIRONMENT` - Same as `environment`
|
|
111
|
+
- `QASE_TESTOPS_API_TOKEN` - Same as `testops.api.token`
|
|
112
|
+
- `QASE_TESTOPS_PROJECT` - Same as `testops.project`
|
|
113
|
+
- `QASE_TESTOPS_RUN_ID` - Pass Run ID from ENV and override reporter option `testops.run.id`
|
|
114
|
+
- `QASE_TESTOPS_RUN_TITLE` - Same as `testops.run.title`
|
|
115
|
+
- `QASE_TESTOPS_RUN_DESCRIPTION` - Same as `testops.run.description`
|
|
116
|
+
|
|
117
|
+
## Requirements
|
|
118
|
+
|
|
119
|
+
We maintain the reporter on LTS versions of Node. You can find the current versions by following the [link](https://nodejs.org/en/about/releases/)
|
|
120
|
+
|
|
121
|
+
`jest >= 28.0.0`
|
|
117
122
|
|
|
118
123
|
<!-- references -->
|
|
119
124
|
|
package/package.json
CHANGED
|
@@ -1,55 +1,64 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "jest-qase-reporter",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "2.0.0-beta.0",
|
|
4
4
|
"description": "Qase TMS Jest Reporter",
|
|
5
5
|
"main": "./dist/index.js",
|
|
6
6
|
"types": "./dist/index.d.ts",
|
|
7
|
+
"exports": {
|
|
8
|
+
".": "./dist/index.js",
|
|
9
|
+
"./jest": "./dist/jest.js",
|
|
10
|
+
"./reporter": "./dist/reporter.js",
|
|
11
|
+
"./package.json": "./package.json"
|
|
12
|
+
},
|
|
13
|
+
"typesVersions": {
|
|
14
|
+
"*": {
|
|
15
|
+
".": [
|
|
16
|
+
"./dist/index.d.ts"
|
|
17
|
+
],
|
|
18
|
+
"jest": [
|
|
19
|
+
"./dist/jest.d.ts"
|
|
20
|
+
],
|
|
21
|
+
"reporter": [
|
|
22
|
+
"./dist/reporter.d.ts"
|
|
23
|
+
]
|
|
24
|
+
}
|
|
25
|
+
},
|
|
7
26
|
"homepage": "https://github.com/qase-tms/qase-javascript",
|
|
8
27
|
"bugs": {
|
|
9
28
|
"url": "https://github.com/qase-tms/qase-javascript/issues"
|
|
10
29
|
},
|
|
11
30
|
"repository": {
|
|
12
31
|
"type": "git",
|
|
13
|
-
"url": "https://github.com/qase-tms/qase-javascript.git"
|
|
32
|
+
"url": "git+https://github.com/qase-tms/qase-javascript.git"
|
|
14
33
|
},
|
|
15
34
|
"engines": {
|
|
16
|
-
"node": ">=
|
|
35
|
+
"node": ">=14"
|
|
17
36
|
},
|
|
18
37
|
"scripts": {
|
|
19
|
-
"
|
|
20
|
-
"
|
|
21
|
-
"
|
|
22
|
-
"
|
|
23
|
-
"build": "npm run clean && npm run dev",
|
|
24
|
-
"test": "jest --coverage",
|
|
25
|
-
"clean": "rm -rf dist || true"
|
|
26
|
-
},
|
|
27
|
-
"author": {
|
|
28
|
-
"name": "Parviz Khavari",
|
|
29
|
-
"email": "csctclan@gmail.com"
|
|
38
|
+
"build": "npm run clean && tsc --project tsconfig.build.json",
|
|
39
|
+
"lint": "eslint .",
|
|
40
|
+
"test": "jest --passWithNoTests",
|
|
41
|
+
"clean": "rm -rf dist"
|
|
30
42
|
},
|
|
43
|
+
"author": "Parviz Khavari <csctclan@gmail.com>",
|
|
31
44
|
"license": "Apache-2.0",
|
|
32
45
|
"dependencies": {
|
|
33
|
-
"
|
|
46
|
+
"lodash.get": "^4.4.2",
|
|
47
|
+
"lodash.has": "^4.5.2",
|
|
48
|
+
"qase-javascript-commons": "^2.0.0-beta.0",
|
|
49
|
+
"uuid": "^9.0.0"
|
|
34
50
|
},
|
|
35
51
|
"devDependencies": {
|
|
36
|
-
"@
|
|
37
|
-
"@jest/reporters": "^
|
|
38
|
-
"@
|
|
39
|
-
"@types/
|
|
40
|
-
"@types/
|
|
41
|
-
"@
|
|
42
|
-
"
|
|
43
|
-
"
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
"
|
|
47
|
-
"eslint-plugin-jsdoc": "^26.0.1",
|
|
48
|
-
"eslint-plugin-prefer-arrow": "^1.2.2",
|
|
49
|
-
"handlebars": "^4.7.7",
|
|
50
|
-
"jest": "^26.6.3",
|
|
51
|
-
"nodemon": "^2.0.6",
|
|
52
|
-
"ts-jest": "^26.4.4",
|
|
53
|
-
"typescript": "^3.9.7"
|
|
52
|
+
"@jest/globals": "^29.5.0",
|
|
53
|
+
"@jest/reporters": "^29.5.0",
|
|
54
|
+
"@jest/test-result": "^29.5.0",
|
|
55
|
+
"@types/jest": "^29.5.2",
|
|
56
|
+
"@types/lodash.get": "^4.4.7",
|
|
57
|
+
"@types/lodash.has": "^4.5.7",
|
|
58
|
+
"jest": "^29.5.0",
|
|
59
|
+
"ts-jest": "^29.1.0"
|
|
60
|
+
},
|
|
61
|
+
"peerDependencies": {
|
|
62
|
+
"jest": ">=28.0.0"
|
|
54
63
|
}
|
|
55
64
|
}
|
package/dist/index.d.ts
DELETED
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
import { Reporter, Test, TestResult } from '@jest/reporters';
|
|
2
|
-
interface QaseOptions {
|
|
3
|
-
apiToken: string;
|
|
4
|
-
basePath?: string;
|
|
5
|
-
rootSuiteTitle?: string;
|
|
6
|
-
projectCode: string;
|
|
7
|
-
runId?: string;
|
|
8
|
-
runPrefix?: string;
|
|
9
|
-
logging?: boolean;
|
|
10
|
-
runComplete?: boolean;
|
|
11
|
-
environmentId?: number;
|
|
12
|
-
}
|
|
13
|
-
declare class QaseReporter implements Reporter {
|
|
14
|
-
private api;
|
|
15
|
-
private options;
|
|
16
|
-
private runId?;
|
|
17
|
-
private isDisabled;
|
|
18
|
-
private publishedResultsCount;
|
|
19
|
-
private preparedTestCases;
|
|
20
|
-
constructor(_: Record<string, unknown>, _options: QaseOptions);
|
|
21
|
-
onRunStart(): Promise<void>;
|
|
22
|
-
onTestResult(_test: Test, testResult: TestResult): Promise<void>;
|
|
23
|
-
onRunComplete(): Promise<void>;
|
|
24
|
-
getLastError(): void;
|
|
25
|
-
private log;
|
|
26
|
-
private getEnv;
|
|
27
|
-
private getCaseIds;
|
|
28
|
-
private logTestItem;
|
|
29
|
-
private createPreparedForPublishTestsArray;
|
|
30
|
-
private publishBulkTestResult;
|
|
31
|
-
private checkProject;
|
|
32
|
-
private createRunObject;
|
|
33
|
-
private createRun;
|
|
34
|
-
private checkRun;
|
|
35
|
-
private createResultCasesArray;
|
|
36
|
-
private createHeaders;
|
|
37
|
-
private getPackageVersion;
|
|
38
|
-
}
|
|
39
|
-
export = QaseReporter;
|