-
Notifications
You must be signed in to change notification settings - Fork 71
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
0.8.6 version breaks tests #559
Comments
Would you provide a reproduction? 🙏 |
Thank you Daniel for quick reaction! Sure. Here it is: Just run I figured out what causes the error: Mapbox map component But I don't know how to fix it. Also as zip: |
@steklopod That repro URL isn't correct. It's just pointing to the base starter template. I think you need to save the stackblitz which will fork it and allow us to see the files. Right now we can't see them. |
@steklopod you're right that the mapbox component seems to break nuxt-vitest. It appears to be running client code on the server. I tried making the component a *.client.vue component, but the issue persists. I did notice some other issues with the code, and made some fixes here. You may be able to remove the plugins directory that I created but I'm not sure. |
Would you provide a runnable reproduction? |
Sure. I just downgraded Here is the link with working tests |
The same is for version Maybe there is a mechanism of ignoring/excluding a tag from rendering in tests? |
It seems to be working fine. I updated nuxt + nuxt-vitest and removed bits from your vitest config that aren't required: https://stackblitz.com/edit/github-e16yng-ysqzqu?file=package.json,vitest.config.ts,tests/setup.ts |
Or is your point that the blog setup bit is required? |
Thank you Daniel for the help 🙏🏻. I found how to fix this.
I updated dependencies and simplified
I installed
Added 1 row in environmentOptions: { nuxt: { domEnvironment: 'jsdom' } }, This is not covered by doc. I found it inside some other issue of this repo. You can check yourself: |
Oh yes, there was a recent breaking change where you need to install either happy-dom or jsdom. If you install happy-dom you do not need to change the config. |
With environmentOptions: { nuxt: { domEnvironment: 'jsdom' } } |
It seems to me that if it works with As we've significantly reworked the module, I'm closing this but please do feel to let me know if it's still an issue for you. 🙏 |
After upgrading to 0.8.6 ot 0.8.7 some of the tests fail with errors. And test task does not stop
Here is
vitest.config.ts
:This is setup file:
Here is an example of failed test:
2023-07-01.12.15.40.mov
2023-07-01.12.18.00.mov
The text was updated successfully, but these errors were encountered: