refactor: deprecate all config types from the main Vitest entrypoint, introduce SerializedConfig
type
#6205
+584
−264
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
All config types rely on node-specific types (from
vite
, for example). I have moved all of them tovitest/node
fromvitest
(which should be runtime agnostic), but we should also review if all of them need to be exported.I also started to type the serialisable config and runtime config that are available in
vitest
entry point and can be imported in your tests.This PR introduces
SerializedConfig
that should be used at runtime instead ofvitest
- previously we just merged it with theResolvedConfig
and removed methods, now it is created manually so it's harder to miss something incompatible. I also plan to add a validator for resolved config values in the future and refactor how config is resolved (right now it's all over the place, but the goal of this PR is to introduce the groundwork and start deprecating node-related types in the main entry point)Please don't delete this checklist! Before submitting the PR, please make sure you do the following:
pnpm-lock.yaml
unless you introduce a new test example.Tests
pnpm test:ci
.Documentation
pnpm run docs
command.Changesets
feat:
,fix:
,perf:
,docs:
, orchore:
.