Skip to content

Commit 1deb310

Browse files
authored
fix: abort and reschedule $effect.pre when necessary (#16335)
* unskip failing test * fix * tidy up * skip_no_async * add comment
1 parent 9412c58 commit 1deb310

File tree

1 file changed

+8
-4
lines changed
  • packages/svelte/tests/runtime-runes/samples/effect-order-7

1 file changed

+8
-4
lines changed

packages/svelte/tests/runtime-runes/samples/effect-order-7/_config.js

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,18 @@ import { flushSync } from 'svelte';
22
import { test } from '../../test';
33

44
export default test({
5-
skip: true,
5+
// For this to work in non-async mode, we would need to abort
6+
// inside `#traverse_effect_tree`, which would be very
7+
// complicated and annoying. Since this hasn't been
8+
// a real issue (AFAICT), we ignore it
9+
skip_no_async: true,
610

7-
async test({ assert, target, logs }) {
11+
async test({ target }) {
812
const [open, close] = target.querySelectorAll('button');
913

1014
flushSync(() => open.click());
11-
flushSync(() => close.click());
1215

13-
assert.deepEqual(logs, [true]);
16+
// if the effect queue isn't aborted after the state change, this will throw
17+
flushSync(() => close.click());
1418
}
1519
});

0 commit comments

Comments
 (0)