pull/11277/head
Rich Harris 1 year ago
parent 6df1839bdc
commit 24e2872a58

@ -263,11 +263,6 @@ async function run_test_variant(
if (runes) {
props = $.proxy({ ...(config.props || {}) });
// TODO get rid
props.$set = (new_props: Record<string, any>) => {
Object.assign(props, new_props);
};
const render = variant === 'hydrate' ? hydrate : mount;
instance = render(mod.default, {
target,

@ -1,4 +1,4 @@
import { flushSync } from '../../../../src/index-client.js';
import { flushSync } from 'svelte';
import { test } from '../../test';
export default test({
@ -14,13 +14,10 @@ export default test({
html: `x 1 2 3 z`,
async test({ assert, target, component }) {
flushSync(() => {
component.foo = 'y';
});
flushSync(() => (component.foo = 'y'));
assert.htmlEqual(target.innerHTML, `y 1 2 3 z`);
// rest props don't generate accessors, so we need to use $set
await component.$set({ bar: 'w' });
flushSync(() => (component.bar = 'w'));
assert.htmlEqual(target.innerHTML, `y 1 2 3 w`);
}
});

Loading…
Cancel
Save