Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: coverage setup #837

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open
Changes from 1 commit
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
8 changes: 6 additions & 2 deletions vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,13 @@ export default defineConfig({
Inspect(),
],
test: {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

With the setup in this PR, 0 tests are run after pnpm test:ui.

Tests run using the following config, which also excludes playground, docs and **/sponsorkit**/** from coverage:

import { coverageConfigDefaults } from 'vitest/config'
  test: {
    environment: 'jsdom',
    globals: true,
    coverage: {
      provider: 'v8',
      exclude: [
        ...coverageConfigDefaults.exclude,
        'playground/**',
        'docs/**',
        '**/sponsorkit**/**',
      ],
    },
  },

Taken from here: Vitest coverage.exclude docs

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @andretchen0 for me they work, but I updated the config with your suggestion

environment: 'jsdom',
exclude: ['docs/*', 'playground/*', 'dist/*', 'node_modules/*'],
globals: true,
threads: false,
environment: 'jsdom',
coverage: {
reporter: ['text', 'json', 'html'],
exclude: ['node_modules', 'dist', 'docs', 'playground', 'src/**/*.d.ts', 'src/**/*.test.ts'],
},
},
build: {
lib: {
Expand Down