nuxt / nuxt/test-utils

`@vitest-environment-options` is not working

Open
#1,541 0 comments 2 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

pending triage
Dominant language
TypeScript
Stars
437
Forks
120
Avg merge
22h 52m
Merged PRs (30d)
23

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 npm@10.8.2
Nuxt version 4.2.2
Nitro version 2.13.0
Builder vite@7.3.1
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

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

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.

Assessment

Tech stack
nuxtjs, typescript
Domain
testing
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.