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 helper doesn't accept options #550

Closed
ghazialhouwari opened this issue Mar 9, 2023 · 2 comments
Closed

mountSuspended helper doesn't accept options #550

ghazialhouwari opened this issue Mar 9, 2023 · 2 comments

Comments

@ghazialhouwari
Copy link
Contributor

I have some components with async setup that require props, slots and other MountOptions. It'd be helpful if mountSuspended supports MountOptions.

Expected behavior

const component = await mountSuspended(SomeComponent, {
  props: {
    foo: 'bar',
  },
  ...
})
@ghazialhouwari
Copy link
Contributor Author

I've put some effort to make this feature work and committed my changes to this branch

However, I'm facing few issues related to mount overloads and would appreciate if someone could help:

  • when I define props via a generic type argument in the component, I don't get type safety for the props in mountSuspended and the below warning appears

Screenshot 2023-03-14 at 16 39 33

@maartenvanhunsel
Copy link
Contributor

@ghazialhouwari let's extend the mountOptions by the last PR @danielroe made for options.route. See https://github.com/danielroe/nuxt-vitest/pull/154/files#diff-d4c4281072871672195289d5adc0accb5595279f487557d1f32783f389bd3507R33

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

No branches or pull requests

3 participants