build-raptor-jest-reporter 0.38.0 → 0.40.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/main.js +18 -4
- package/package.json +2 -3
package/main.js
CHANGED
|
@@ -1,17 +1,31 @@
|
|
|
1
|
-
const
|
|
1
|
+
const path = require('path')
|
|
2
2
|
|
|
3
3
|
module.exports = class BuildRaptorJestReporter {
|
|
4
4
|
constructor(config) {
|
|
5
|
-
|
|
5
|
+
if (!config.outputFile) {
|
|
6
|
+
throw new Error(`outputFile is missing (must be specified in the config)`)
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
this.file = path.isAbsolute(config.outputFile) ? config.outputFile : path.join(config.rootDir, config.outputFile)
|
|
10
|
+
this.cases = []
|
|
6
11
|
}
|
|
7
12
|
|
|
8
13
|
getLastError() {}
|
|
9
14
|
onRunStart() {}
|
|
10
15
|
|
|
11
16
|
onTestCaseResult(test, testCaseResult) {
|
|
12
|
-
|
|
17
|
+
this.cases.push({ testFile: test.path, testCaseResult })
|
|
13
18
|
}
|
|
14
19
|
onRunComplete() {
|
|
15
|
-
|
|
20
|
+
const cases = this.cases.map(at => ({
|
|
21
|
+
testCaseFullName: at.testCaseResult.fullName,
|
|
22
|
+
fileName: at.testFile,
|
|
23
|
+
ancestorTitles: at.testCaseResult.ancestorTitles,
|
|
24
|
+
title: at.testCaseResult.title,
|
|
25
|
+
status: at.testCaseResult.status,
|
|
26
|
+
duration: at.testCaseResult.duration ?? undefined,
|
|
27
|
+
}))
|
|
28
|
+
const output = { cases }
|
|
29
|
+
fs.writeFileSync(this.file, JSON.stringify(output))
|
|
16
30
|
}
|
|
17
31
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "build-raptor-jest-reporter",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.40.0",
|
|
4
4
|
"description": "",
|
|
5
5
|
"keywords": [],
|
|
6
6
|
"author": "",
|
|
@@ -16,7 +16,6 @@
|
|
|
16
16
|
"preset": "../../jest.preset.js"
|
|
17
17
|
},
|
|
18
18
|
"dependencies": {
|
|
19
|
-
"jest-reporter-impl": "0.
|
|
20
|
-
"zod": "^3.11.6"
|
|
19
|
+
"jest-reporter-impl": "0.40.0"
|
|
21
20
|
}
|
|
22
21
|
}
|