-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Description
Describe the bug
prior to vitest 3.2.0, up until 3.2.0-beta.3, plugins added through test config received config.resolve.conditions values, now they are undefined.
this breaks a utility plugin in @testing-library/svelte
used by sveltes official vitest template sv add vitest
to inject the browser condition after the node condition for client tests.
reported here: sveltejs/cli#579
utility plugin code https://github.com/testing-library/svelte-testing-library/blob/main/src/vite.js#L47
the inject of browser condition does not happen because indexOf node condition is -1
Reproduction
https://stackblitz.com/edit/vitest-dev-vitest-xdsbmkd6?file=vite.config.ts
see console output, first run with 3.2.0 logs undefined
, second run with 3.2.0-beta.3 logs node,development|production
System Info
stackblitz, vitest 3.2.0
Used Package Manager
pnpm
Validations
- Follow our Code of Conduct
- Read the Contributing Guidelines.
- Read the docs.
- Check that there isn't already an issue that reports the same bug to avoid creating a duplicate.
- Check that this is a concrete bug. For Q&A open a GitHub Discussion or join our Discord Chat Server.
- The provided reproduction is a minimal reproducible example of the bug.