-
Notifications
You must be signed in to change notification settings - Fork 3.2k
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
Nuxt auto import component does not work in Component Testing #24141
Comments
Hey team! Please add your planning poker estimate with Zenhub @amehta265 @astone123 @lmiller1990 @marktnoonan @mike-plummer @rockindahizzy @warrensplayer @ZachJW34 |
I do not think we should spend a ton of time here, Nuxt is not very popular, but worth seeing if we can offer a work around at least. I think we should time box it to 1.5 days max. |
It was the subject of what seemed like half the talks at VueConf Toronto! I just got home and was excited to try everything out.. Cypress, TypeScript, Vue3, Nuxt3, Veutify3, it's going to be amazing! Now I've run into a wall of issues trying to run tests. Seems like Nuxt3 isn't set up out of the box to run any. Gotta wrap my head around Vitest and Cypress to try and point them in the correct direction. First no vite config found (hidden behind wall of Nuxt magic) and now Cypress can't handle the auto imports... Sorry, this should probably be direct towards Nuxt - but if you can get automatic imports in Cypress - that would be amazing! 🙏🏼 |
I'm having a similar issue in Vue Jest: vuejs/vue-jest#430 Now Nuxt is (finally) a stable 3.0.0 release, we can look at supportig it... we started discussing with Nuxt team a while ago but the API was unstable, but maybe it's more stable now: nuxt/nuxt#14534 Related:
In the best interest of the Nuxt community, I think we need some kind of general solution for the "make my testing framework know about Nuxt auto imports" problem. Then we can use it in Cypress, Playwright can use it, as well as Vue Jest, Vitest, etc. If you can share some of the tests you'd like to/are trying to write, we could use those as a kind of acceptance criteria to drive the development of this feature? |
is there any example/experimentation repo where Cypress Component Testing works even without Auto Import? For now, I could only make it work by adding a |
I don't know of an example yet -- due to various recent events, our team has pretty limited bandwidth and isn't able to commit to a timeline for Nuxt support. There's some ongoing discussion here: nuxt/nuxt#14534
What do you mean by "destroyed before running"? Why is that? What happens if you explicit import? At that point, you are working with a standard Vue component (or maybe not?) What other Nuxt magic should we account for other than auto-imports? |
Ignore my comments, those were previous attempts before the Nuxt team highlighted how to access the I opened a request for integration here: #25719 |
^ Thanks @floroz. There's info scattered everywhere - I am going to track it all in nuxt/nuxt#24141. |
Current behavior
When testing a component with children components that are loaded via Nuxt's auto import mechanism, the children are not rendered in the AUT.
Desired behavior
The children components are rendered without user intervention
The text was updated successfully, but these errors were encountered: