vitest-dev / vscode

VS Code extension for Vitest
https://vitest.dev/vscode
MIT License
732 stars 81 forks source link

Configuration file exclude/include ignored #184

Closed maasha closed 9 months ago

maasha commented 9 months ago

I have the following vite.config.ts in my project excluding tests from the temp dir:

import react from '@vitejs/plugin-react'
import { defineConfig } from 'vitest/config'
import tailwindcss from 'tailwindcss'

/**
 * Configuration for ViteJS
 *
 * @url https://vitejs.dev/config/
 */
export default defineConfig({
    base: './',
    plugins: [react()],
    test: {
        reporters: ['default', 'junit'],
        coverage: {
            reporter: ['text', 'json', 'html', 'cobertura'],
            provider: 'istanbul',
        },
        environment: 'jsdom',
        globals: true,
        setupFiles: './src/common/test/test-setup.ts',
        exclude: ['**/node_modules/**', '**/temp/**'],
    },
    server: {
        port: 8000,
    },
    css: {
        postcss: {
            plugins: [tailwindcss],
        },
    },
    build: {
        rollupOptions: {
            output: {
                assetFileNames: 'output.css',
            },
        },
    },
})

However, in the vscode test pane the temp directory is shown and all tests within shown as failed, even though the temp directory should be ignored. When I change the setting of the vitest-dev/vscode extension to include temp it works as expected.

  "vitest.exclude": [

    "**/node_modules/**",
    "**/dist/**",
    "**/temp/**",
    "**/cypress/**",
    "**/.{idea,git,cache,output,temp}/**"
  ]

But I was expecting the exclude options from the projects config to be upheld.

mash-graz commented 9 months ago

Befor PR #192 gets merged, this issue shouldn't be seen as solved!