N
Nuxtβ€’5mo ago
snowy

file path error in testing: can't find global-setup

I've been banging my head against this for a while but it turns out the example app has the same issue: https://nuxt.com/docs/examples/advanced/testing open a new terminal, run nuxi test and get:
Error: Failed to load url /home/projects/nuxt-examples-tpwdwa/node_modules/@nuxt/test-utils/dist/shared/runtime/global-setup (resolved id: /home/projects/nuxt-examples-tpwdwa/node_modules/@nuxt/test-utils/dist/shared/runtime/global-setup). Does the file exist?
Error: Failed to load url /home/projects/nuxt-examples-tpwdwa/node_modules/@nuxt/test-utils/dist/shared/runtime/global-setup (resolved id: /home/projects/nuxt-examples-tpwdwa/node_modules/@nuxt/test-utils/dist/shared/runtime/global-setup). Does the file exist?
I think this is the same issue as reported at https://github.com/nuxt/test-utils/issues/818 but wanted to ask here in case there's a known workaround or anything other than patching test-utils?
Nuxt
Testing Β· Nuxt Examples
This example shows how to test your Nuxt application.
GitHub
Runtime dir miss-calculated Β· Issue #818 Β· nuxt/test-utils
Hi! πŸ‘‹ Firstly, thanks for your work on this project! πŸ™‚ Today I used patch-package to patch @nuxt/[email protected] for the project I'm working on. When starting nuxt test from a fresh install o...
1 Reply
snowy
snowyOPβ€’5mo ago
so it turns out this is only an issue when using nuxi test, running vitest directly works fine. i'm not sure if doing that means missing out on some extra functionality but at least the tests run! πŸ™‚
Want results from more Discord servers?
Add your server