`@vitest-environment-options` is not working
Maintainers usually reply within 1 day
Assessment
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 45/100
- Issue type
- Bug
- Clarity
- Mostly clear
- Activity status
- Stale
- Tech stack
- nuxtjs, typescript
- Domain
- testing
Research direction
Start with the StackBlitz reproduction and test/app.nuxt.spec.ts, then trace how @vitest-environment-options is passed to the environment setup and how environmentOptions from the config is handled. Done means the directive options are merged with the configured options and the reproduction tests pass.
Written by the indexing model from the issue text.
Description
Environment
Nuxt project info:
| Operating system | Linux 5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/143.0.0.0 Safari/537.36 |
| CPU | Intel(R) Core(TM) i9-9880H CPU @ 2.30GHz (8 cores) |
| Node.js version | v20.19.1 |
| nuxt/cli version | 3.32.0 |
| Package manager | [email protected] |
| Nuxt version | 4.2.2 |
| Nitro version | 2.13.0 |
| Builder | [email protected] |
| Config | compatibilityDate, devtools |
| Modules | - |
Reproduction
https://stackblitz.com/edit/github-cjvr31cb?file=test%2Fapp.nuxt.spec.ts
Describe the bug
using @vitest-environment-options in a test file causes tests to fail.
environment setup appears to receive only the options from the @vitest-environment-options.
it would be better to merge these with the environmentOptions from the config.
Additional context
No response
Logs
- Dominant language
- TypeScript
- Stars
- 440
- Forks
- 120
- Avg merge
- 5d 22h
- Merged PRs (30d)
- 22
Getting set up
- No Dockerfile or Docker Compose file
- No pull request template
- Read the contributing 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.
More from nuxt/test-utils
-
pending triage
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
nuxt/test-utils#1842 ·
Maintainers usually reply within 1 day
-
Nuxt v4.6.0 nightly: `@nuxt/test-utils/module` causes colocated tests to be registered as app files, causing import-protection errors during devPossibly taken @yamachi4416 claimed this 6 days ago. Openpending triage
Difficulty 3/5 1-2 days Newbie friendliness 68/100
nuxt/test-utils#1833 · 3 comments ·
Maintainers usually reply within 1 day
-
pending triage
Difficulty 3/5 1-2 days Newbie friendliness 55/100
nuxt/test-utils#1671 · 4 comments · 1 reaction ·
Maintainers usually reply within 1 day
-
pending triage
Difficulty 4/5 3-5 days Newbie friendliness 52/100
nuxt/test-utils#1607 · 2 comments ·
Maintainers usually reply within 1 day
-
Nuxt `multiApp` breaks nuxt/test-utilsPossibly taken @nicolaspayot claimed this 871 days ago. Openpending triage
Difficulty 4/5 3-5 days Newbie friendliness 48/100
nuxt/test-utils#1521 · 1 comment · 4 reactions ·
Maintainers usually reply within 1 day
Similar issues
-
community first-timers-only good first issue hacktoberfest help wanted low hanging fruit up-for-grabs
Difficulty 1/5 Under an hour Newbie friendliness 75/100
lingdojo/kana-dojo#32018 · 1 comment · 5 reactions ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
paperclipai/paperclip#15751 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
BuilderIO/agent-native#7275 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
Maintainers usually reply within 1 day