fix: limit test coverage to src directory only
This commit is contained in:
4
.github/workflows/test.yml
vendored
4
.github/workflows/test.yml
vendored
@@ -20,7 +20,7 @@ jobs:
|
|||||||
- name: Install dependencies and run tests
|
- name: Install dependencies and run tests
|
||||||
run: |
|
run: |
|
||||||
npm ci
|
npm ci
|
||||||
npm run test -- --run --coverage
|
npm run test:coverage
|
||||||
- uses: coverallsapp/github-action@master
|
- uses: coverallsapp/github-action@master
|
||||||
with:
|
with:
|
||||||
github-token: ${{ secrets.GITHUB_TOKEN }}
|
github-token: ${{ secrets.GITHUB_TOKEN }}
|
||||||
@@ -38,7 +38,7 @@ jobs:
|
|||||||
- name: Install dependencies and run tests
|
- name: Install dependencies and run tests
|
||||||
run: |
|
run: |
|
||||||
npm ci
|
npm ci
|
||||||
npm run test -- --run
|
npm run test
|
||||||
|
|
||||||
test: # make sure the action works on a clean machine without building
|
test: # make sure the action works on a clean machine without building
|
||||||
strategy:
|
strategy:
|
||||||
|
|||||||
@@ -14,8 +14,8 @@
|
|||||||
"format-check": "prettier --check **/*.ts",
|
"format-check": "prettier --check **/*.ts",
|
||||||
"lint": "eslint src/**/*.ts",
|
"lint": "eslint src/**/*.ts",
|
||||||
"pack": "ncc build --v8-cache --source-map --target es2020",
|
"pack": "ncc build --v8-cache --source-map --target es2020",
|
||||||
"test": "vitest",
|
"test": "vitest --run",
|
||||||
"test:coverage": "vitest --coverage",
|
"test:coverage": "vitest --run --coverage",
|
||||||
"all": "npm run build && npm run format && npm run lint && npm run pack && npm run test:coverage"
|
"all": "npm run build && npm run format && npm run lint && npm run pack && npm run test:coverage"
|
||||||
},
|
},
|
||||||
"repository": {
|
"repository": {
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import { defineConfig } from 'vitest/config';
|
import { defineConfig } from 'vitest/config'
|
||||||
|
|
||||||
export default defineConfig({
|
export default defineConfig({
|
||||||
test: {
|
test: {
|
||||||
@@ -6,7 +6,9 @@ export default defineConfig({
|
|||||||
environment: 'node',
|
environment: 'node',
|
||||||
include: ['__tests__/**/*.test.ts'],
|
include: ['__tests__/**/*.test.ts'],
|
||||||
coverage: {
|
coverage: {
|
||||||
reporter: ['text', 'json', 'html', 'lcov'],
|
include: ['src/**/*.ts'], // Only target the src directory
|
||||||
},
|
exclude: ['lib/**'], // Exclude the lib directory
|
||||||
},
|
reporter: ['text', 'json', 'html', 'lcov']
|
||||||
});
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|||||||
Reference in New Issue
Block a user