chore: setup coverage report

This commit is contained in:
Pooya Parsa
2024-08-06 20:53:00 +02:00
parent 2744f21f7d
commit 23fc41f4b1
3 changed files with 19 additions and 2 deletions

View File

@@ -28,4 +28,5 @@ jobs:
- run: pnpm lint - run: pnpm lint
- run: pnpm test:types - run: pnpm test:types
- run: pnpm build - run: pnpm build
- run: pnpm vitest - run: pnpm vitest run --coverage
- uses: codecov/codecov-action@v4

View File

@@ -78,7 +78,7 @@
"play:sse": "bun test/fixture/sse.ts", "play:sse": "bun test/fixture/sse.ts",
"play:uws": "jiti test/fixture/uws.ts", "play:uws": "jiti test/fixture/uws.ts",
"release": "pnpm test && pnpm build && changelogen --release && npm publish && git push --follow-tags", "release": "pnpm test && pnpm build && changelogen --release && npm publish && git push --follow-tags",
"test": "pnpm lint && pnpm test:types && vitest run", "test": "pnpm lint && pnpm test:types && vitest run --coverage",
"test:types": "tsc --noEmit --skipLibCheck" "test:types": "tsc --noEmit --skipLibCheck"
}, },
"resolutions": { "resolutions": {

16
vitest.config.mjs Normal file
View File

@@ -0,0 +1,16 @@
import { defineConfig } from "vitest/config";
export default defineConfig({
test: {
typecheck: { enabled: true },
coverage: {
include: ["src/**/*.ts"],
exclude: [
"src/websocket/*",
"src/adapters/*",
"!src/adapters/node.ts",
"!src/adapters/uws.ts",
],
},
},
});