vitest-dev / vitest

Next generation testing framework powered by Vite.
https://vitest.dev
MIT License
13.03k stars 1.17k forks source link

`pool: 'forks'` doesn't work inside `vitest.config.js` #5385

Closed viceice closed 7 months ago

viceice commented 7 months ago

Describe the bug

pool: 'forks' option is ignored inside vitest.config.js. Using --pool=forks on cli works as expected.

Reproduction

import viteAngular from '@analogjs/vite-plugin-angular';
import tsconfigPaths from 'vite-tsconfig-paths';
import { defineConfig } from 'vitest/config';

/**
 * @type {typeof viteAngular}
 */
const angular = viteAngular.default;

// https://vitejs.dev/config/
export default defineConfig(({ mode }) => {
    return {
        plugins: [angular({ tsconfig: './tsconfig.spec.json' }), tsconfigPaths({ projects: ['./tsconfig.spec.json'] })],
        test: {
            globals: true,
            environment: 'happy-dom',
            pool: 'forks', // Doesn't work
        },
    };
});

System Info

System:
    OS: Windows 11 10.0.22631
    CPU: (32) x64 AMD Ryzen 9 5950X 16-Core Processor
    Memory: 19.87 GB / 63.92 GB
  Binaries:
    Node: 20.11.1 - ~\scoop\apps\nodejs-lts\current\node.EXE
    pnpm: 8.15.4 - ~\scoop\apps\nodejs-lts\current\bin\pnpm.CMD
  Browsers:
    Chrome: 122.0.6261.112
    Edge: Chromium (122.0.2365.66)
    Internet Explorer: 11.0.22621.1
  npmPackages:
    @vitest/coverage-v8: 1.3.1 => 1.3.1
    vitest: 1.3.1 => 1.3.1

Used Package Manager

pnpm

Validations

viceice commented 7 months ago

😕 it seems @analogjs/vite-plugin-angular is causing the issue 😞

viceice commented 7 months ago