Skip to content

Commit

Permalink
feat: add coverage
Browse files Browse the repository at this point in the history
Signed-off-by: John Molakvoæ <skjnldsv@protonmail.com>
  • Loading branch information
skjnldsv committed Jun 20, 2023
1 parent cfc691b commit 408d209
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 3 deletions.
12 changes: 10 additions & 2 deletions .github/workflows/node-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ jobs:
uses: skjnldsv/read-package-engines-version-actions@8205673bab74a63eb9b8093402fd9e0e018663a1
id: versions
with:
fallbackNode: '^12'
fallbackNpm: '^6'
fallbackNode: '^16'
fallbackNpm: '^7'

test:
runs-on: ubuntu-latest
Expand All @@ -50,6 +50,14 @@ jobs:
- name: Test
run: npm run test

- name: Test and process coverage
run: npm run test:coverage

- name: Collect coverage
uses: codecov/codecov-action@eaaf4bedf32dbdc6b720b63067d99c4d77d6047d # v3.1.4
with:
files: ./coverage/lcov.info

jsunit:
runs-on: ubuntu-latest
needs: versions
Expand Down
8 changes: 7 additions & 1 deletion jest.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,13 @@ const config: Config = {
],
clearMocks: true,
collectCoverageFrom: [
'<rootDir>/**/*.{js,vue}',
'<rootDir>/**/*.{ts,js,vue}',
],
coveragePathIgnorePatterns: [
'<rootDir>/__mocks__/',
'<rootDir>/__tests__/',
'<rootDir>/cypress/',
'<rootDir>/node_modules/',
],

setupFilesAfterEnv: ['<rootDir>/__tests__/jest-setup.ts'],
Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
"lint:fix": "eslint 'apps/*/src/**/*.{vue,js}' 'core/src/**/*.{vue,js}' --fix",
"test": "jest",
"test:watch": "jest --watch",
"test:coverage": "jest --coverage",
"test:jsunit": "karma start tests/karma.config.js --single-run",
"sass": "sass --style compressed --load-path core/css core/css/ $(for cssdir in $(find apps -mindepth 2 -maxdepth 2 -name \"css\"); do if ! $(git check-ignore -q $cssdir); then echo -n \"$cssdir \"; fi; done)",
"sass:watch": "sass --watch --load-path core/css core/css/ $(for cssdir in $(find apps -mindepth 2 -maxdepth 2 -name \"css\"); do if ! $(git check-ignore -q $cssdir); then echo -n \"$cssdir \"; fi; done)",
Expand Down

0 comments on commit 408d209

Please sign in to comment.