From 34d27e3d9f825c5ea7cd71919eb9b61dda5d91e2 Mon Sep 17 00:00:00 2001 From: Martin Stievenart Date: Wed, 22 Jan 2025 16:36:36 +0100 Subject: [PATCH] test(slash): fix vitest coverage --- slash/react/vitest.config.ts | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/slash/react/vitest.config.ts b/slash/react/vitest.config.ts index 4abb62ea9..4ed7a0850 100644 --- a/slash/react/vitest.config.ts +++ b/slash/react/vitest.config.ts @@ -3,11 +3,11 @@ /// import react from "@vitejs/plugin-react"; -import { defineProject } from "vitest/config"; +import { defineConfig } from "vitest/config"; // https://vitejs.dev/config/ // eslint-disable-next-line import/no-default-export -export default defineProject({ +export default defineConfig({ plugins: [react()], test: { globals: true, @@ -15,5 +15,20 @@ export default defineProject({ setupFiles: "./vitest.setup.ts", name: "slash", css: true, + coverage: { + reporter: ["text", "lcov", "html"], + include: ["src/**/*.{js,mjs,cjs,ts,mts,cts,jsx,tsx}"], + exclude: [ + "**/*.stories.ts?(x)", + "**/storybook-static/*", + "**/vitest.setup.ts", + "**/.storybook/", + "**/coverage/", + "**/dist/*", + "**/index.ts", + "**/__tests__/**", + "**/*.d.ts", + ], + }, }, });