Skip to content

Commit

Permalink
Update Jest configuration and add test report generation
Browse files Browse the repository at this point in the history
  • Loading branch information
2wndrhs committed Jan 10, 2024
1 parent fea9eaf commit 4481701
Show file tree
Hide file tree
Showing 3 changed files with 59 additions and 5 deletions.
17 changes: 13 additions & 4 deletions .github/workflows/run-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,23 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v2

- name: Use Node.js
uses: actions/setup-node@v2
with:
node-version: '20'

- uses: ArtiomTr/jest-coverage-report-action@v2
- name: Install Dependencies
run: npm ci

- name: Run Jest Tests
run: npm test -- --coverage --ci --reporters=default --reporters=jest-junit -- '02. 렌더링/02'

- name: Test Report
uses: dorny/test-reporter@v1
if: success() || failure() # run this step even if previous step failed
with:
working-directory: './02. 렌더링/02'
test-script: npm test
name: JEST Tests # Name of the check run which will be created
path: junit.xml # Path to test results
reporter: jest-junit # Format of test results
43 changes: 43 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 3 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@
"description": "2024 프레임워크 없는 프론트엔드 개발 스터디",
"type": "module",
"scripts": {
"test": "node --experimental-vm-modules node_modules/jest/bin/jest.js"
"test": "node --experimental-vm-modules node_modules/jest/bin/jest.js",
"test:report": "node --experimental-vm-modules node_modules/jest/bin/jest.js --ci --reporters=default --reporters=jest-junit"
},
"repository": {
"type": "git",
Expand All @@ -22,6 +23,7 @@
"eslint-plugin-import": "^2.29.1",
"jest": "^29.7.0",
"jest-environment-jsdom": "^29.7.0",
"jest-junit": "^16.0.0",
"prettier": "^3.1.1"
},
"engineStrict": true,
Expand Down

0 comments on commit 4481701

Please sign in to comment.