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

@ -263,11 +263,6 @@ async function run_test_variant(
if (runes) { if (runes) {
props = $.proxy({ ...(config.props || {}) }); 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; const render = variant === 'hydrate' ? hydrate : mount;
instance = render(mod.default, { instance = render(mod.default, {
target, target,

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

Loading…
Cancel
Save