mirror of https://github.com/sveltejs/svelte
add a test for #8459
parent
d42ca041dd
commit
5afef37513
@ -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…
Reference in new issue