Skip to content

Commit 54e330b

Browse files
chore: add test coverage testing with Codecov (#79)
* chore: add test coverage testing with Codecov * Add lcov to cspell.json words * Add vitest/coverage-c8 package
1 parent e411b35 commit 54e330b

File tree

8 files changed

+257
-3
lines changed

8 files changed

+257
-3
lines changed

.github/workflows/test.yml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,4 +12,8 @@ jobs:
1212
steps:
1313
- uses: actions/checkout@v3
1414
- uses: ./.github/actions/prepare
15-
- run: pnpm test
15+
- run: pnpm run test --coverage
16+
- name: Codecov
17+
uses: codecov/codecov-action@v3
18+
with:
19+
github-token: ${{ secrets.GITHUB_TOKEN }}

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
1+
coverage/
12
dist/
23
node_modules/

.npmignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
.github/
22
.vscode/
33
*.test.*
4+
coverage/

.ts-prunerc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
{
22
"error": true,
3-
"skip": "src/index.ts"
3+
"skip": "(src/index\\.ts|vitest\\.config\\.ts)"
44
}

cspell.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
22
"dictionaries": ["typescript"],
33
"ignorePaths": [".github", "dist", "node_modules", "pnpm-lock.yaml"],
4-
"words": ["commitlint"]
4+
"words": ["commitlint", "lcov"]
55
}

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
"@semantic-release/release-notes-generator": "^10.0.3",
1111
"@typescript-eslint/eslint-plugin": "^5.38.1",
1212
"@typescript-eslint/parser": "^5.38.1",
13+
"@vitest/coverage-c8": "^0.25.4",
1314
"cspell": "^6.12.0",
1415
"eslint": "^8.24.0",
1516
"eslint-config-prettier": "^8.5.0",

pnpm-lock.yaml

Lines changed: 238 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

vitest.config.ts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
import { defineConfig } from "vitest/config";
2+
3+
export default defineConfig({
4+
test: {
5+
coverage: {
6+
reporter: ["html", "lcov"],
7+
},
8+
},
9+
});

0 commit comments

Comments
 (0)