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/inspect-with-untracked/_config.js

21 lines
440 B

import { flushSync } from 'svelte';
import { test } from '../../test';
export default test({
compileOptions: {
dev: true
},
async test({ assert, target, logs }) {
const [a, b] = target.querySelectorAll('button');
assert.deepEqual(logs, ['init', 0]);
flushSync(() => {
b?.click();
});
assert.deepEqual(logs, ['init', 0]);
flushSync(() => {
a?.click();
});
assert.deepEqual(logs, ['init', 0, 'update', 1]);
}
});