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 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
15 changes: 12 additions & 3 deletions vite.config.ts
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
/// <reference types="vitest" />

import vue from '@vitejs/plugin-vue'

import copy from 'rollup-plugin-copy'

import { defineConfig } from 'vite'
import banner from 'vite-plugin-banner'
import dts from 'vite-plugin-dts'

import Inspect from 'vite-plugin-inspect'

import { coverageConfigDefaults } from 'vitest/config'

/* import analyze from 'rollup-plugin-analyzer'
*/ /* import { visualizer } from 'rollup-plugin-visualizer' */
import { bold, gray, lightGreen, yellow } from 'kolorist'
Expand Down Expand Up @@ -46,7 +47,15 @@ export default defineConfig({
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',
globals: true,
threads: false,
coverage: {
provider: 'v8',
exclude: [
...coverageConfigDefaults.exclude,
'playground/**',
'docs/**',
'**/sponsorkit**/**',
],
},
},
build: {
lib: {
Expand Down
Loading