diff --git a/.changeset/fix-vitest-workspace-environment.md b/.changeset/fix-vitest-workspace-environment.md new file mode 100644 index 0000000..f036d4b --- /dev/null +++ b/.changeset/fix-vitest-workspace-environment.md @@ -0,0 +1,5 @@ +--- +'vite-plugin-solid': patch +--- + +Avoid overriding environments configured in Vitest workspaces and projects with the `jsdom` default diff --git a/src/index.ts b/src/index.ts index ead2980..1b41941 100644 --- a/src/index.ts +++ b/src/index.ts @@ -238,7 +238,7 @@ export default function solidPlugin(options: Partial = {}): Plugin { ? [userTest.setupFiles] : userTest.setupFiles || []; - if (!userTest.environment && !options.ssr) { + if (!userTest.environment && !userTest.workspace && !userTest.projects && !options.ssr) { test.environment = 'jsdom'; }