nuxt / test-utils

🧪 Test utilities for Nuxt
http://nuxt.com/docs/getting-started/testing
MIT License
287 stars 75 forks source link

Test fails if useNuxtApp used #744

Open martinsjek opened 5 months ago

martinsjek commented 5 months ago

Environment

Reproduction

https://stackblitz.com/edit/github-vy6psx-sn3lfr

Describe the bug

[Vue warn]: Cannot mutate <script setup> binding "nuxtApp" from Options API. at <MountSuspendedComponent > at <MountSuspendedHelper> at <Anonymous ref="VTU_COMPONENT" > at <VTUROOT> [Vue warn]: Unhandled error during execution of render function at <MountSuspendedComponent > at <MountSuspendedHelper> at <Anonymous ref="VTU_COMPONENT" > at <VTUROOT>

I get this error message whenever I try to use useNudxtApp() in a component. Before the merge of nuxt-vitest and @nuxt/text-utils, this worked fine.

Additional context

Tests can be ran with: npm run test ./pages/tests/index.spec.ts

Logs

No response