Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,5 +21,10 @@ updates:
patterns:
- 'playwright'
- 'playwright-core'
# The coverage provider requires the exact vitest version it was released with.
vitest:
patterns:
- 'vitest'
- '@vitest/*'
assignees:
- sadjow
2 changes: 2 additions & 0 deletions docs/CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,3 +17,5 @@ Contact any of our current maintainers, or send us an email at [community@stackb
Use the pnpm version pinned in `package.json`. With Corepack installed, run `corepack enable`, then `pnpm install --frozen-lockfile` and `pnpm dev:prepare` from the repository root. The module and playground share `pnpm-lock.yaml`; install dependencies from the root and use `pnpm --dir playground build` to build the playground directly.

Before submitting a change, run `pnpm lint`, `pnpm format:check`, `pnpm test:types`, `pnpm test`, and `pnpm test:package`. Prettier owns formatting and ESLint checks everything else; `pnpm format` applies the formatting. For runtime changes, also run `pnpm test:compatibility` and `NUXT_VERSION=3 pnpm test:compatibility` to test independent consumers that are server-rendered, prerendered, and rendered only in the browser. `test/integration-rendering-modes.test.ts` covers the same three modes in `pnpm test`; extend it when a change affects when the module captures a visit.

Run `pnpm test:coverage` to see how much of `src/` the tests cover. It runs the same tests as `pnpm test`, prints a per-file table, and writes an HTML report to `coverage/index.html`. The numbers count only code that runs inside the Vitest process: the unit tests and the module setup that runs while fixtures build. Code that the integration tests exercise in the browser or in the fixture's Nuxt server is not counted, so runtime files such as `src/runtime/composables.ts` can show low coverage even when integration tests use them. Read uncovered lines in `src/runtime` as having no unit test, not as untested.
2 changes: 2 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@
"lint:fix": "eslint . --fix && prettier --write .",
"test": "vitest run",
"test:watch": "vitest watch",
"test:coverage": "vitest run --coverage",
"test:types": "vue-tsc --noEmit && cd playground && vue-tsc --noEmit",
"test:package": "pnpm run prepack && node scripts/test-package.mjs",
"test:compatibility": "pnpm run prepack && node scripts/test-package.mjs --app"
Expand All @@ -68,6 +69,7 @@
"@nuxt/schema": "^4.2.1",
"@nuxt/test-utils": "^3.20.1 || ^4.0.0",
"@types/node": "^26.2.0",
"@vitest/coverage-v8": "^5.0.0",
"changelogen": "^0.6.1",
"eslint": "^10.7.0",
"eslint-config-prettier": "^10.1.5",
Expand Down
76 changes: 68 additions & 8 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 9 additions & 0 deletions vitest.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import { defineConfig } from 'vitest/config'

export default defineConfig({
test: {
coverage: {
include: ['src/**'],
},
},
})
Loading