mirror of https://github.com/sveltejs/svelte
parent
0f5fe6552d
commit
a0f89e8ce2
@ -0,0 +1,11 @@
|
|||||||
|
export default {
|
||||||
|
test({ component, target, assert, raf }) {
|
||||||
|
assert.htmlEqual(target.innerHTML, 'a');
|
||||||
|
|
||||||
|
component.arr = [];
|
||||||
|
assert.htmlEqual(target.innerHTML, '<div>empty</div>');
|
||||||
|
|
||||||
|
raf.tick(50);
|
||||||
|
assert.equal(target.querySelector("div").foo, 0.5);
|
||||||
|
},
|
||||||
|
};
|
@ -0,0 +1,11 @@
|
|||||||
|
<script>
|
||||||
|
export let arr = ['a'];
|
||||||
|
function foo(node, params){
|
||||||
|
return { tick(t){ node.foo = t; }, duration: 100 }
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
{#each arr as v}
|
||||||
|
{v}
|
||||||
|
{:else}
|
||||||
|
<div transition:foo>empty</div>
|
||||||
|
{/each}
|
Loading…
Reference in new issue