From 23fc41f4b1517bbbbaa41eaf53c08fbad6e41cba Mon Sep 17 00:00:00 2001 From: Pooya Parsa Date: Tue, 6 Aug 2024 20:53:00 +0200 Subject: [PATCH] chore: setup coverage report --- .github/workflows/ci.yml | 3 ++- package.json | 2 +- vitest.config.mjs | 16 ++++++++++++++++ 3 files changed, 19 insertions(+), 2 deletions(-) create mode 100644 vitest.config.mjs diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index b02a79d..6954675 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -28,4 +28,5 @@ jobs: - run: pnpm lint - run: pnpm test:types - run: pnpm build - - run: pnpm vitest + - run: pnpm vitest run --coverage + - uses: codecov/codecov-action@v4 diff --git a/package.json b/package.json index eb29b46..db526ea 100644 --- a/package.json +++ b/package.json @@ -78,7 +78,7 @@ "play:sse": "bun test/fixture/sse.ts", "play:uws": "jiti test/fixture/uws.ts", "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" }, "resolutions": { diff --git a/vitest.config.mjs b/vitest.config.mjs new file mode 100644 index 0000000..1694f83 --- /dev/null +++ b/vitest.config.mjs @@ -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", + ], + }, + }, +});