add a test for #8459

pull/8461/head
lovasoa 3 years ago
parent d42ca041dd
commit 5afef37513
No known key found for this signature in database
GPG Key ID: AC8DB8E033B44AB8

@ -0,0 +1,7 @@
<script>
import { onMount } from 'svelte';
export let mounts;
onMount(() => { ++mounts });
</script>
This component has been mounted {mounts} times.

@ -0,0 +1,6 @@
export default {
async test({ assert, target }) {
await new Promise(f => setTimeout(f, 0));
assert.htmlEqual(target.innerHTML, 'This component has been mounted 1 times.');
}
};

@ -0,0 +1,14 @@
<script>
import Component from "./Component.svelte";
let mounts = 0;
let promise = Promise.resolve();
(async () => {
await Promise.resolve();
promise = Promise.resolve();
})();
</script>
{#await promise then _}
<Component bind:mounts />
{/await}
Loading…
Cancel
Save