From 369760e427eff94e21520a97d91c238d61a2dcb7 Mon Sep 17 00:00:00 2001 From: alvarosabu Date: Tue, 17 Sep 2024 10:38:21 +0200 Subject: [PATCH 1/2] chore: coverage setup --- vite.config.ts | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/vite.config.ts b/vite.config.ts index 07481e332..e75fbb339 100644 --- a/vite.config.ts +++ b/vite.config.ts @@ -44,9 +44,13 @@ export default defineConfig({ Inspect(), ], test: { - 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: { From 3b87ba1c0c3befd82082c1ca7cc6c0543eba4a8c Mon Sep 17 00:00:00 2001 From: alvarosabu Date: Wed, 18 Sep 2024 06:24:04 +0200 Subject: [PATCH 2/2] chore: use coverageConfigDefaults --- vite.config.ts | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/vite.config.ts b/vite.config.ts index e75fbb339..8e21e98bd 100644 --- a/vite.config.ts +++ b/vite.config.ts @@ -1,14 +1,15 @@ /// 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' @@ -44,12 +45,16 @@ export default defineConfig({ Inspect(), ], test: { - exclude: ['docs/*', 'playground/*', 'dist/*', 'node_modules/*'], - globals: true, environment: 'jsdom', + globals: true, coverage: { - reporter: ['text', 'json', 'html'], - exclude: ['node_modules', 'dist', 'docs', 'playground', 'src/**/*.d.ts', 'src/**/*.test.ts'], + provider: 'v8', + exclude: [ + ...coverageConfigDefaults.exclude, + 'playground/**', + 'docs/**', + '**/sponsorkit**/**', + ], }, }, build: {