From cec3ebc013cee7b7a52fb58d1141280501053fd3 Mon Sep 17 00:00:00 2001 From: Simon Holthausen Date: Fri, 8 May 2026 14:43:53 +0200 Subject: [PATCH] update tests --- .../samples/async-stale-derived-6/_config.js | 4 +- .../samples/async-stale-derived-7/_config.js | 7 +-- .../async-state-new-branch-1/_config.js | 14 ++---- .../async-state-new-branch-2/_config.js | 8 +--- .../async-state-new-branch-3/_config.js | 10 +--- .../async-state-new-branch/Child.svelte | 7 --- .../samples/async-state-new-branch/_config.js | 46 ------------------- .../async-state-new-branch/main.svelte | 28 ----------- 8 files changed, 11 insertions(+), 113 deletions(-) delete mode 100644 packages/svelte/tests/runtime-runes/samples/async-state-new-branch/Child.svelte delete mode 100644 packages/svelte/tests/runtime-runes/samples/async-state-new-branch/_config.js delete mode 100644 packages/svelte/tests/runtime-runes/samples/async-state-new-branch/main.svelte diff --git a/packages/svelte/tests/runtime-runes/samples/async-stale-derived-6/_config.js b/packages/svelte/tests/runtime-runes/samples/async-stale-derived-6/_config.js index 5b951d6c49..4bdbc503db 100644 --- a/packages/svelte/tests/runtime-runes/samples/async-stale-derived-6/_config.js +++ b/packages/svelte/tests/runtime-runes/samples/async-stale-derived-6/_config.js @@ -23,12 +23,10 @@ export default test({ pop.click(); await tick(); - assert.htmlEqual(p.innerHTML, `1 + 0 = 1 | 1 0`); + assert.htmlEqual(p.innerHTML, `0 + 0 = 0 | 0 0`); shift.click(); await tick(); - pop.click(); - await tick(); assert.htmlEqual(p.innerHTML, `1 + 2 = 3 | 1 1`); } }); diff --git a/packages/svelte/tests/runtime-runes/samples/async-stale-derived-7/_config.js b/packages/svelte/tests/runtime-runes/samples/async-stale-derived-7/_config.js index a6f1833d67..b7b4de13a7 100644 --- a/packages/svelte/tests/runtime-runes/samples/async-stale-derived-7/_config.js +++ b/packages/svelte/tests/runtime-runes/samples/async-stale-derived-7/_config.js @@ -19,11 +19,12 @@ export default test({ await tick(); assert.htmlEqual(p.innerHTML, `0 + 0 = 0 | 0 0`); - // Check that the first batch can still resolve before the second even if one of its async values - // is already superseeded (but the subsequent batch as a whole is still pending). + // Previously check that the first batch can still resolve before the second even if one of its async values + // is already superseeded (but the subsequent batch as a whole is still pending) - now that batches are + // entangled this no longer happens and instead everything is waited on. shift_1.click(); await tick(); - assert.htmlEqual(p.innerHTML, `1 + 0 = 1 | 1 0`); + assert.htmlEqual(p.innerHTML, `0 + 0 = 0 | 0 0`); shift_1.click(); await tick(); diff --git a/packages/svelte/tests/runtime-runes/samples/async-state-new-branch-1/_config.js b/packages/svelte/tests/runtime-runes/samples/async-state-new-branch-1/_config.js index dee8af2446..601fbdeabe 100644 --- a/packages/svelte/tests/runtime-runes/samples/async-state-new-branch-1/_config.js +++ b/packages/svelte/tests/runtime-runes/samples/async-state-new-branch-1/_config.js @@ -7,29 +7,23 @@ export default test({ x.click(); await tick(); + assert.deepEqual(logs, ['universe']); y.click(); await tick(); + assert.deepEqual(logs, ['universe', 'universe']); assert.htmlEqual( target.innerHTML, ` - world - ` // if this does not show world - that would also be ok + ` ); resolve.click(); await tick(); - assert.deepEqual(logs, [ - 'universe', - 'world', - '$effect: world', - '$effect: universe', - '$effect: universe' - ]); - // assert.deepEqual(logs, ['universe', 'universe', '$effect: universe', '$effect: universe']); // this would also be ok + assert.deepEqual(logs, ['universe', 'universe', '$effect: universe', '$effect: universe']); assert.htmlEqual( target.innerHTML, ` diff --git a/packages/svelte/tests/runtime-runes/samples/async-state-new-branch-2/_config.js b/packages/svelte/tests/runtime-runes/samples/async-state-new-branch-2/_config.js index d99f0df731..00b38262e8 100644 --- a/packages/svelte/tests/runtime-runes/samples/async-state-new-branch-2/_config.js +++ b/packages/svelte/tests/runtime-runes/samples/async-state-new-branch-2/_config.js @@ -17,13 +17,7 @@ export default test({
- world - "world" - world - world - world - "world" - ` // if this does not show world "world" world world world "world" - then this would also be ok + ` ); resolve.click(); diff --git a/packages/svelte/tests/runtime-runes/samples/async-state-new-branch-3/_config.js b/packages/svelte/tests/runtime-runes/samples/async-state-new-branch-3/_config.js index eb4485e8a6..fe2765e76f 100644 --- a/packages/svelte/tests/runtime-runes/samples/async-state-new-branch-3/_config.js +++ b/packages/svelte/tests/runtime-runes/samples/async-state-new-branch-3/_config.js @@ -29,17 +29,9 @@ export default test({
- world - "world" - world - world - world - "world" - ` // if this does not show world "world" world world world "world" - then this would also be ok + ` ); - resolve.click(); - await tick(); resolve.click(); await tick(); assert.htmlEqual( diff --git a/packages/svelte/tests/runtime-runes/samples/async-state-new-branch/Child.svelte b/packages/svelte/tests/runtime-runes/samples/async-state-new-branch/Child.svelte deleted file mode 100644 index 6b765526c8..0000000000 --- a/packages/svelte/tests/runtime-runes/samples/async-state-new-branch/Child.svelte +++ /dev/null @@ -1,7 +0,0 @@ - - -{x} diff --git a/packages/svelte/tests/runtime-runes/samples/async-state-new-branch/_config.js b/packages/svelte/tests/runtime-runes/samples/async-state-new-branch/_config.js deleted file mode 100644 index f4b6cc777b..0000000000 --- a/packages/svelte/tests/runtime-runes/samples/async-state-new-branch/_config.js +++ /dev/null @@ -1,46 +0,0 @@ -import { tick } from 'svelte'; -import { test } from '../../test'; - -export default test({ - async test({ assert, target, logs }) { - const [x, y, resolve] = target.querySelectorAll('button'); - - x.click(); - await tick(); - assert.deepEqual(logs, ['universe']); - - y.click(); - await tick(); - assert.deepEqual(logs, ['universe', 'world', '$effect: world']); - assert.htmlEqual( - target.innerHTML, - ` - - - - world - ` - ); - - resolve.click(); - await tick(); - assert.deepEqual(logs, [ - 'universe', - 'world', - '$effect: world', - '$effect: universe', - '$effect: universe' - ]); - assert.htmlEqual( - target.innerHTML, - ` - - - - universe - universe - universe - ` - ); - } -}); diff --git a/packages/svelte/tests/runtime-runes/samples/async-state-new-branch/main.svelte b/packages/svelte/tests/runtime-runes/samples/async-state-new-branch/main.svelte deleted file mode 100644 index 8edc718de2..0000000000 --- a/packages/svelte/tests/runtime-runes/samples/async-state-new-branch/main.svelte +++ /dev/null @@ -1,28 +0,0 @@ - - - - - - - - -{#if x === 'universe'} - {await delay(x)} - -{/if} - -{#if y > 0} - -{/if}