Skip to content

Commit ea8b747

Browse files
Publish test results (#363)
* Publish test results * Update test.yml * Update test.yml * Update test.yml * Update test.yml
1 parent c0db65e commit ea8b747

File tree

3 files changed

+16
-2
lines changed

3 files changed

+16
-2
lines changed

.github/workflows/test.yml

+9
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,9 @@ concurrency:
1313
group: ${{ github.workflow }}
1414
jobs:
1515
test:
16+
permissions:
17+
checks: write
18+
pull-requests: write
1619
runs-on: ubuntu-latest
1720
steps:
1821
- name: Harden Runner
@@ -35,3 +38,9 @@ jobs:
3538
- name: Run coverage
3639
run: npm test -- --coverage
3740
- uses: codecov/codecov-action@eaaf4bedf32dbdc6b720b63067d99c4d77d6047d # v3.1.4
41+
- name: Publish Test Results
42+
uses: step-security/publish-unit-test-result-action@v1
43+
if: always()
44+
with:
45+
files: |
46+
reports/*.xml

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ lib-cov
2020

2121
# Coverage directory used by tools like istanbul
2222
coverage
23+
reports
2324
*.lcov
2425

2526
# nyc test coverage

jest.config.ts

+6-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
/** @type {import('ts-jest/dist/types').InitialOptionsTsJest} */
22
export default {
3-
preset: 'ts-jest',
4-
testEnvironment: 'node',
3+
preset: "ts-jest",
4+
testEnvironment: "node",
5+
reporters: [
6+
"default",
7+
["jest-junit", { outputDirectory: "reports", outputName: "report.xml" }],
8+
],
59
};

0 commit comments

Comments
 (0)