Skip to content

Commit 4b2df72

Browse files
author
hackape
committed
fix: update testcase
1 parent 841b641 commit 4b2df72

File tree

3 files changed

+14
-5
lines changed

3 files changed

+14
-5
lines changed

packages/playground/src/App.svelte

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<script>
2-
import Counter from "./lib/Counter.svelte";
2+
export let foo;
3+
let bar = 'baz';
4+
foo.bar = bar;
35
</script>
46

5-
<div>
6-
Hello world!
7-
</div>
7+
child: {typeof foo}

packages/svelte/test/runtime/samples/binding-backflow/Child.svelte

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,10 @@
66
value = { foo: 'kid' }
77
}
88
9+
if (testcase === 'init_mutate') {
10+
value.foo = 'kid'
11+
}
12+
913
$: if (testcase === 'reactive_update') {
1014
value = { foo: 'kid' }
1115
}

packages/svelte/test/runtime/samples/binding-backflow/_config.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,8 @@ export default {
66
{ testcase: 'child_default_populate_parent', value: undefined },
77
{ testcase: 'reactive_update', value: { foo: 'mon' } },
88
{ testcase: 'reactive_mutate', value: { foo: 'mon' } },
9-
{ testcase: 'init_update', value: { foo: 'mon' } }
9+
{ testcase: 'init_update', value: { foo: 'mon' } },
10+
{ testcase: 'init_mutate', value: { foo: 'mon' } }
1011
]
1112
};
1213
},
@@ -36,5 +37,9 @@ export default {
3637
p = parents['init_update'];
3738
assert.deepEqual(p.value, { foo: 'kid' });
3839
assert.equal(p.updates.length, 2);
40+
41+
p = parents['init_mutate'];
42+
assert.deepEqual(p.value, { foo: 'kid' });
43+
assert.equal(p.updates.length, 2);
3944
}
4045
};

0 commit comments

Comments
 (0)