Quantcast
Channel: Active questions tagged svelte - Stack Overflow
Viewing all articles
Browse latest Browse all 1541

Vitest - Configuration Not Excluding file from Test Coverage in Sveltekit Project

$
0
0

I'm currently working on a Svelte project with vitest for testing, and I'm facing an issue with excluding a specific file, myfile.js, from the test coverage. Despite configuring vitest with the exclude option, the file is still being included in the coverage report.

vitest.config.js

import { defineConfig } from 'vite';import svelte from '@sveltejs/vite-plugin-svelte';export default defineConfig({  plugins: [svelte({ hot: !process.env.VITEST })],  test: {    globals: true,    environment: 'jsdom',    setupFiles: ['src/setupTest.js'],    coverage: {      reporter: ['text', 'lcov'],      all: true    },    exclude: ['myFile.js', '**/node_modules/**', '**/dist/**']  }});

Viewing all articles
Browse latest Browse all 1541

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>