internal: scheduler: add failing test for infinite onmount loop

This test shows how onMount is called repeatedly when creating a component dynamically.
The loop counter is totally arbitrary and is there to prevent a hard-crash in the CI.
pull/4316/head
David A Kondrad 6 years ago
parent bf006a43e5
commit 164622ea64

@ -0,0 +1,6 @@
export default {
test({ assert, component }) {
const { count } = component;
assert.deepEqual(count, 1);
}
};

@ -0,0 +1,16 @@
<script>
import { onMount } from 'svelte';
import Child from './Child.svelte';
let root;
export let count = 0;
onMount(() => {
if (count < 5) {
count++;
let child = new Child({target:root});
}
});
</script>
<div bind:this={root}></div>
Loading…
Cancel
Save