You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
svelte/packages/svelte/tests/runtime-runes/samples/flush-sync-no-scheduled/_config.js

17 lines
601 B

import { ok, test } from '../../test';
export default test({
async test({ assert, target }) {
const btn = target.querySelector('button');
const main = target.querySelector('main');
ok(main);
console.log(main.innerHTML);
assert.htmlEqual(main.innerHTML, `<div>true</div>`);
// we don't want to use flush sync (or tick that use it inside) since we are testing that calling `flushSync` once
// when there are no scheduled effects does not cause reactivity to break
btn?.click();
await Promise.resolve();
assert.htmlEqual(main.innerHTML, `<div>false</div> <div>false</div>`);
}
});