Replies: 2 comments 6 replies
-
Can you provide us a small repro online using https://stackblitz.com/github/vuejs/create-vue-templates/tree/main/typescript-vitest?file=src%2Fcomponents%2F__tests__%2FHelloWorld.spec.ts ? It only takes a few minutes, and we'll be able to take a look |
Beta Was this translation helpful? Give feedback.
5 replies
-
If I get your issue right, you need to wait for the async component to load const parentWrapper = mount(ParentComponent);
await flushPromises();
const child = parentWrapper.getComponent(ASYNCChild);
expect(child.props('childProp')).toBe('12345'); For vitest you need to add one more function: const parentWrapper = mount(ParentComponent);
await flushPromises();
await vi.dynamicImportSettled();
const child = parentWrapper.getComponent(ASYNCChild);
expect(child.props('childProp')).toBe('12345'); |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi,
i have an component with:
when testing all props of child are converted to attributes
so instead of
i have to do:
i can work with this but it would be much nicer to get the props as with an sync component ...
am i doing something wrong?
Beta Was this translation helpful? Give feedback.
All reactions