build-raptor-jest-reporter 0.130.0 → 0.132.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/index.js +0 -0
- package/package.json +7 -16
- package/dist/src/index.js +0 -47
- /package/{dist/src/index.d.ts → index.d.ts} +0 -0
package/index.js
ADDED
|
File without changes
|
package/package.json
CHANGED
|
@@ -1,20 +1,11 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "build-raptor-jest-reporter",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"
|
|
5
|
-
"
|
|
6
|
-
"
|
|
7
|
-
"main": "dist/src/index.js",
|
|
3
|
+
"version": "0.132.0",
|
|
4
|
+
"type": "module",
|
|
5
|
+
"main": "index.js",
|
|
6
|
+
"types": "index.d.ts",
|
|
8
7
|
"files": [
|
|
9
|
-
"
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
"build": "tsc -b && cp src/a.js dist/src/index.js",
|
|
13
|
-
"build:post": "cp src/a.js dist/src/index.js",
|
|
14
|
-
"test": "jest"
|
|
15
|
-
},
|
|
16
|
-
"jest": {
|
|
17
|
-
"preset": "../../jest.preset.js"
|
|
18
|
-
},
|
|
19
|
-
"nohoist": true
|
|
8
|
+
"index.js",
|
|
9
|
+
"index.d.ts"
|
|
10
|
+
]
|
|
20
11
|
}
|
package/dist/src/index.js
DELETED
|
@@ -1,47 +0,0 @@
|
|
|
1
|
-
(() => {
|
|
2
|
-
const fs = require(`fs`)
|
|
3
|
-
const path = require(`path`)
|
|
4
|
-
const dist = path.dirname(__dirname)
|
|
5
|
-
const distNodeModules = path.join(dist, `node_modules`)
|
|
6
|
-
const distDeps = path.join(dist, `deps`)
|
|
7
|
-
fs.rmSync(distNodeModules, {force: true, recursive: true})
|
|
8
|
-
fs.mkdirSync(distNodeModules, {recursive: true})
|
|
9
|
-
if (fs.existsSync(distDeps)) {
|
|
10
|
-
for (const p of fs.readdirSync(distDeps)) {
|
|
11
|
-
fs.symlinkSync(`../deps/${p}`, `${distNodeModules}/${p}`)
|
|
12
|
-
}
|
|
13
|
-
}
|
|
14
|
-
})()
|
|
15
|
-
const path = require('path')
|
|
16
|
-
const fs = require('fs')
|
|
17
|
-
|
|
18
|
-
module.exports = class BuildRaptorJestReporter {
|
|
19
|
-
constructor(config) {
|
|
20
|
-
if (!config.outputFile) {
|
|
21
|
-
throw new Error(`outputFile is missing (must be specified in the config)`)
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
this.file = path.isAbsolute(config.outputFile) ? config.outputFile : path.join(config.rootDir, config.outputFile)
|
|
25
|
-
this.cases = []
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
getLastError() {}
|
|
29
|
-
onRunStart() {}
|
|
30
|
-
|
|
31
|
-
onTestCaseResult(test, testCaseResult) {
|
|
32
|
-
this.cases.push({ testFile: test.path, testCaseResult })
|
|
33
|
-
}
|
|
34
|
-
onRunComplete() {
|
|
35
|
-
const cases = this.cases.map(at => ({
|
|
36
|
-
testCaseFullName: at.testCaseResult.fullName,
|
|
37
|
-
fileName: at.testFile,
|
|
38
|
-
ancestorTitles: at.testCaseResult.ancestorTitles,
|
|
39
|
-
title: at.testCaseResult.title,
|
|
40
|
-
status: at.testCaseResult.status,
|
|
41
|
-
duration: at.testCaseResult.duration ?? undefined,
|
|
42
|
-
message: at.testCaseResult.failureMessages?.join('\n'),
|
|
43
|
-
}))
|
|
44
|
-
const output = { cases }
|
|
45
|
-
fs.writeFileSync(this.file, JSON.stringify(output))
|
|
46
|
-
}
|
|
47
|
-
}
|
|
File without changes
|