Skip to content
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

mountSuspended with shallow: true option gets stuck #525

Closed
gbyesiltas opened this issue Jun 22, 2023 · 3 comments · Fixed by #632
Closed

mountSuspended with shallow: true option gets stuck #525

gbyesiltas opened this issue Jun 22, 2023 · 3 comments · Fixed by #632

Comments

@gbyesiltas
Copy link

Hello there,
I was trying to use the mountSuspended function with shallow: true but it gets stuck and the test fails timing-out. I also tested and got the same behaviour in the tests from the playground project from this repo (see screenshot below)

Screenshot 2023-06-22 at 14 19 15
@oskarols
Copy link
Contributor

oskarols commented Jun 26, 2023

I think what is happening is that shallow rendering is stubbing the <Suspense> component, and without this it will just get stuck and not render the children.

Edit: One can explicitly skip stubbing of Suspense via VTU config, but you still get stuck due to implementation details of mountSuspended() since it uses an anonymous component. I suppose some changes would have to be done inside that to allow for shallow rendering to work.

@gbyesiltas
Copy link
Author

I think what is happening is that shallow rendering is stubbing the <Suspense> component, and without this it will just get stuck and not render the children.

Edit: One can explicitly skip stubbing of Suspense via VTU config, but you still get stuck due to implementation details of mountSuspended() since it uses an anonymous component. I suppose some changes would have to be done inside that to allow for shallow rendering to work.

Thanks for the detailed reply 🫶

Yeah I believe it is definitely something worth investigating because for most people keeping the unit tests as isolated as possible is a big factor and I pretty much always used shallowMount on vue-test-utils

@OleksandrAfonichev
Copy link

Hey there!
Any updates on this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants