diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 65870e0..59b6e4d 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -20,7 +20,7 @@ jobs: - name: Install dependencies and run tests run: | npm ci - npm run test -- --run --coverage + npm run test:coverage - uses: coverallsapp/github-action@master with: github-token: ${{ secrets.GITHUB_TOKEN }} @@ -38,7 +38,7 @@ jobs: - name: Install dependencies and run tests run: | npm ci - npm run test -- --run + npm run test test: # make sure the action works on a clean machine without building strategy: diff --git a/package.json b/package.json index 25f77e2..c0b10fa 100644 --- a/package.json +++ b/package.json @@ -14,8 +14,8 @@ "format-check": "prettier --check **/*.ts", "lint": "eslint src/**/*.ts", "pack": "ncc build --v8-cache --source-map --target es2020", - "test": "vitest", - "test:coverage": "vitest --coverage", + "test": "vitest --run", + "test:coverage": "vitest --run --coverage", "all": "npm run build && npm run format && npm run lint && npm run pack && npm run test:coverage" }, "repository": { diff --git a/vitest.config.ts b/vitest.config.ts index d83b705..9c3a4c6 100644 --- a/vitest.config.ts +++ b/vitest.config.ts @@ -1,4 +1,4 @@ -import { defineConfig } from 'vitest/config'; +import { defineConfig } from 'vitest/config' export default defineConfig({ test: { @@ -6,7 +6,9 @@ export default defineConfig({ environment: 'node', include: ['__tests__/**/*.test.ts'], 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'] + } + } +})