Skip to content

Commit cf68885

Browse files
Modification to create junit report
1 parent b71f5df commit cf68885

File tree

5 files changed

+113
-9
lines changed

5 files changed

+113
-9
lines changed

.github/workflows/run-tests-by-group.yml

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,4 +45,12 @@ jobs:
4545
npm run test:multiple_characters
4646
elif [ "${{ github.event.inputs.testGroup }}" == "filter_characters" ]; then
4747
npm run test:filter_characters
48-
fi
48+
fi
49+
env:
50+
CI: true
51+
52+
- name: Upload test results
53+
uses: actions/upload-artifact@v2
54+
with:
55+
name: test-results
56+
path: junit.xml

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ lerna-debug.log*
99

1010
# Diagnostic reports (https://nodejs.org/api/report.html)
1111
report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json
12+
junit.xml
1213

1314
# Runtime data
1415
pids
@@ -122,7 +123,7 @@ dist
122123
# Stores VSCode versions used for testing VSCode extensions
123124
.vscode-test
124125

125-
# yarn v2
126+
# yarn v2f
126127
.yarn/cache
127128
.yarn/unplugged
128129
.yarn/build-state.yml

jest.config.ts

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,17 @@
1-
import { Config } from '@jest/types';
1+
import { Config } from "@jest/types";
22

33
const config: Config.InitialOptions = {
4-
preset: 'ts-jest',
5-
testEnvironment: 'node',
6-
setupFiles: ['<rootDir>/src/setupTests.ts'],
7-
runner: "groups"
4+
preset: "ts-jest",
5+
testEnvironment: "node",
6+
setupFiles: ["<rootDir>/src/setupTests.ts"],
7+
runner: "groups",
8+
reporters: [
9+
"default",
10+
[
11+
"jest-junit",
12+
{ outputDirectory: "./test-results", outputName: "test-results.xml" },
13+
],
14+
],
815
};
916

10-
export default config;
17+
export default config;

package-lock.json

Lines changed: 87 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,13 @@
1313
"test:all_characters": "jest --group=all_characters",
1414
"test:multiple_characters": "jest --group=multiple_characters",
1515
"test:filter_characters": "jest --group=filter_characters",
16-
"test:sanity": "jest --group=sanity_tests"
16+
"test:sanity": "jest --ci --reporters=default --reporters=jest-junit --group=sanity_tests"
1717
},
1818
"devDependencies": {
1919
"@types/jest": "^29.5.12",
2020
"@types/supertest": "^6.0.2",
2121
"jest": "^29.7.0",
22+
"jest-html-reporter": "^3.10.2",
2223
"jest-runner-groups": "^2.2.0",
2324
"supertest": "^7.0.0",
2425
"ts-jest": "^29.1.4",

0 commit comments

Comments
 (0)