nuxt / nuxt/test-utils

allow running `setupFiles` before nuxt environment

Open
#577 8 comments 2 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement good first issue vitest-environment
Dominant language
TypeScript
Stars
437
Forks
120
Avg merge
22h 52m
Merged PRs (30d)
23

Description

I am using FormKit in some of my components, and formkit is throwing a ResizeObserver is not defined error when I'm running my tests with the jsdom environment instead of the happy-dom environment

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 by tracing how setupFiles and the Nuxt environment are initialized in the test utilities, then reproduce the issue with jsdom and a FormKit component. Done means setupFiles runs before the Nuxt environment so FormKit no longer encounters a missing ResizeObserver under jsdom.

Written by the indexing model from the issue text.

Assessment

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.