Skip to content

Commit

Permalink
馃敤 Added test coverage script (#10)
Browse files Browse the repository at this point in the history
  • Loading branch information
thecarlo committed Jan 4, 2024
1 parent ad2d5bf commit b7d22a5
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 9 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,5 +33,5 @@ jobs:
- name: Build
run: npm run build

- name: Test
run: npm test
- name: Tests
run: npm run test:coverage
6 changes: 0 additions & 6 deletions .github/workflows/publish-on-tag.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,6 @@ jobs:
- name: Build
run: npm run build

- name: Prettier
run: npm run prettier

- name: Lint
run: npm run lint

- name: Publish to npm
run: npm publish --access public
env:
Expand Down
2 changes: 1 addition & 1 deletion .husky/pre-push
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@
. "$(dirname -- "$0")/_/husky.sh"

npx tsc
npm test
npm run test:coverage
9 changes: 9 additions & 0 deletions jest.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,14 @@ const config: Config.InitialOptions = {
'@configuration/(.*)': '<rootDir>/src/configuration/$1',
'@maps/(.*)': '<rootDir>/src/maps/$1',
},
coverageThreshold: {
global: {
statements: 80,
branches: 80,
functions: 80,
lines: 80,
},
},
coverageReporters: ['text', 'lcov', 'clover', 'html'],
};
export default config;
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
"scripts": {
"build": "npx tsc && tsup",
"test": "jest",
"test:coverage": "jest --coverage --silent --maxWorkers=50%",
"lint": "eslint 'src/**/*.ts'",
"lint:fix": "eslint --fix 'src/**/*.ts'",
"prettier": "prettier --check 'src/**/*.ts'",
Expand Down

0 comments on commit b7d22a5

Please sign in to comment.