How I can test dynamic import with svelte
AdaltonLeite opened this issue · 2 comments
AdaltonLeite commented
Hi guys,
Has anyone tried testing dynamic imports with svelte?
I have the following scenario:
<script lang="ts">
let Component: ComponentType<SvelteComponentTyped<Component>>;
onMount(async () => {
Component = (await import('../../../component')).Default;
});
</script>
<svelte:component this={Component} ... />
In my test when I try to render this dynamic component it always fails and in the output I realize that it does not even render the component in fact, it seems that it does not wait for the promise to be resolved, has anyone gone through this or has any suggestions?