Skip to content

Commit d7e48cb

Browse files
committed
Test report within Github Actions
1 parent 9af53ff commit d7e48cb

File tree

5 files changed

+98
-0
lines changed

5 files changed

+98
-0
lines changed

.cspell.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
"codecov",
1212
"CODELYZER",
1313
"codeql",
14+
"dorny",
1415
"Dsonar",
1516
"eslintplugin",
1617
"eslintrule",

.github/workflows/ci.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,13 @@ jobs:
3838
cache: "npm"
3939
- run: npm ci --no-fund
4040
- run: npm run test
41+
- name: Test Report
42+
uses: dorny/test-reporter@v1
43+
if: success() || failure() # Run this step even if previous step failed.
44+
with:
45+
name: "test report (node v${{ matrix.node-version }})"
46+
path: coverage/junit.xml
47+
reporter: jest-junit
4148

4249
copyright:
4350
if: ${{ github.ref == 'refs/heads/master' }}

jest.config.js

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,22 @@ module.exports = {
99
"!**/node_modules/**",
1010
"!**/external/**",
1111
],
12+
reporters: [
13+
"default",
14+
[
15+
// Needed for CI workflow Github Action Job Summary.
16+
// See https://github.com/dorny/test-reporter#supported-formats
17+
"jest-junit",
18+
{
19+
outputDirectory: "coverage",
20+
ancestorSeparator: " › ",
21+
uniqueOutputName: "false",
22+
suiteNameTemplate: "{filepath}",
23+
classNameTemplate: "{classname}",
24+
titleTemplate: "{title}",
25+
},
26+
],
27+
],
1228
globals: {
1329
"ts-jest": {
1430
tsconfig: "tsconfig.test.json",

package-lock.json

Lines changed: 73 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: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,7 @@
5959
"eslint-plugin-prettier": "^4.2.1",
6060
"eslint-plugin-security": "^1.5.0",
6161
"jest": "^28.1.3",
62+
"jest-junit": "^14.0.1",
6263
"lockfile-lint": "^4.8.0",
6364
"rimraf": "3.0.2",
6465
"ts-jest": "^28.0.8",

0 commit comments

Comments
 (0)