Skip to content

Commit

Permalink
chore: add code coverage
Browse files Browse the repository at this point in the history
  • Loading branch information
dotmh committed Nov 7, 2024
1 parent 032df7b commit 42a24ae
Show file tree
Hide file tree
Showing 5 changed files with 644 additions and 236 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ Optional
- [Typescript](https://www.typescriptlang.org/) language
- [PNPM](https://pnpm.io/) for package managing, also set up as a workspace
- Tests are been done on [VITEST](https://vitest.dev/)
- Code Coverage is done with Istanbul and will output HTML and JSON, as well as Text on the command line
- CI / CD is been handled by [github actions](https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-nodejs)

### Supported
Expand Down
3 changes: 2 additions & 1 deletion libs/template/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@
"scripts": {
"build": "tsc",
"test": "vitest --run",
"test:watch": "vitest"
"test:watch": "vitest",
"test:coverage": "vitest --coverage --run"
},
"keywords": [],
"author": "",
Expand Down
11 changes: 11 additions & 0 deletions libs/template/vitest.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
// vitest.config.ts
import {defineConfig} from 'vitest/config';

export default defineConfig({
test: {
coverage: {
provider: 'istanbul',
reporter: ['text', 'json', 'html'],
},
},
});
6 changes: 4 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
"scripts": {
"test": "pnpm run -r test",
"test:watch": "vitest",
"test:coverage": "pnpm run -r test:coverage",
"prepare": "husky",
"build": "smart-builder",
"build:dry-run": "SKIP_BUILD=yes smart-builder",
Expand All @@ -31,13 +32,14 @@
"@dotmh/tsconfig": "^2.1.0",
"@secretlint/secretlint-rule-preset-recommend": "^9.0.0",
"@types/node": "20.16.10",
"@vitest/coverage-istanbul": "^2.1.4",
"eslint": "^8.57.1",
"husky": "^9.1.6",
"prettier": "^3.3.3",
"secretlint": "^9.0.0",
"tsx": "^4.19.1",
"tsx": "^4.19.2",
"typescript": "^5.6.3",
"vitest": "^2.1.3"
"vitest": "^2.1.4"
},
"engines": {
"node": "^20.14.0",
Expand Down
Loading

0 comments on commit 42a24ae

Please sign in to comment.