vitest-dev / vitest-dev/vitest
Pass configOptions to environment setup
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 17.1k
- Forks
- 2k
- Avg merge
- 1d 22h
- Merged PRs (30d)
- 94
Description
Clear and concise description of the problem
When @vitest-environment-options is specified in a test file, those options are passed to the custom environment's setup method.
With access to the environmentOptions defined in the config, custom environments would be able to override specific options on a per-test basis, which would make @vitest-environment-options more flexible.
Thank you for the guidance in the pull request🙏
Suggested solution
How about passing configOptions as an additional parameter to setup and setupVM ?
Alternative
No response
Additional context
No response
Validations
- Follow our Code of Conduct
- Read the Contributing Guidelines.
- Read the docs.
- Check that there isn't already an issue that requests the same feature to avoid creating a duplicate.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by locating the custom environment setup and setupVM entry points, then trace how @vitest-environment-options and configured environmentOptions are currently handled. Add coverage for the configOptions parameter and verify that config-defined options can be overridden per test without breaking existing environment setup behavior.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- testing
- Issue type
- Feature
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Active
- Clarity
- Mostly clear
- Newbie friendliness
- 68/100