Skip to content

Commit 6c6d213

Browse files
fix: Added action for jest
Added a separate action for jest
1 parent ad2dc3f commit 6c6d213

File tree

4 files changed

+14
-5
lines changed

4 files changed

+14
-5
lines changed

Diff for: .github/workflows/nodejs.yml

+11-1
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,16 @@ jobs:
3030
npm install
3131
env:
3232
CI: true
33+
- name: Unit tests with Jest
34+
uses: mattallty/jest-github-action@v1
35+
with:
36+
changes-only: false
37+
test-command: npm test:unit
38+
- name: Code Coverage Report
39+
uses: codecov/codecov-action@v1
40+
with:
41+
file: ./coverage/jest/coverage-final.json # optional
42+
fail_ci_if_error: true # optional (default = false)
3343
- name: End-to-end Tests with Cypress
3444
uses: cypress-io/github-action@v1
3545
with:
@@ -47,7 +57,7 @@ jobs:
4757
uses: codecov/codecov-action@v1
4858
with:
4959
token: ${{ secrets.CODECOV_TOKEN }} # not required for public repos
50-
file: ./coverag*/coverage-final.json # optional
60+
file: ./coverage/cypress/coverage-final.json # optional
5161
fail_ci_if_error: true # optional (default = false)
5262
- name: Build PWA distribution for production
5363
run: |

Diff for: .gitignore

+1-2
Original file line numberDiff line numberDiff line change
@@ -26,5 +26,4 @@ cypress/screenshots/
2626

2727
# Test coverage reports
2828
.nyc_output/
29-
coverage/
30-
coverage-jest/
29+
coverage/

Diff for: jest.config.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ module.exports = {
1313
'.*\\.vue$': 'vue-jest'
1414
},
1515
collectCoverage: true,
16-
coverageDirectory: "./coverage-jest",
16+
coverageDirectory: "./coverage/jest/",
1717
coverageReporters: ["json"],
1818
collectCoverageFrom: [
1919
'<rootDir>/**/*.vue',

Diff for: package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
"serve": "vue-cli-service serve",
88
"build": "vue-cli-service build",
99
"lint": "vue-cli-service lint",
10-
"codecov": "codecov -f coverage/coverage-final.json && codecov -f coverage-jest/coverage-final.json",
10+
"codecov": "codecov -f coverage/coverage-final.json && codecov -f coverage/jest/coverage-final.json",
1111
"test:unit": "jest",
1212
"test:e2e": "npx cypress run",
1313
"test": "npm run test:unit && npm run test:e2e"

0 commit comments

Comments
 (0)