From 562c9e3c7beb1912b31cca8e513306b7a33a0f03 Mon Sep 17 00:00:00 2001 From: Rich Harris Date: Mon, 30 Jun 2025 19:57:45 -0400 Subject: [PATCH] remove extraneous tests - these pass with or without the src change --- .../Component.svelte | 11 ---- .../_config.js | 63 ------------------- .../main.svelte | 52 --------------- .../Component.svelte | 14 ----- .../_config.js | 63 ------------------- .../main.svelte | 52 --------------- .../Component.svelte | 11 ---- .../_config.js | 49 --------------- .../main.svelte | 41 ------------ 9 files changed, 356 deletions(-) delete mode 100644 packages/svelte/tests/runtime-runes/samples/bindable-props-cleanup-no-setter/Component.svelte delete mode 100644 packages/svelte/tests/runtime-runes/samples/bindable-props-cleanup-no-setter/_config.js delete mode 100644 packages/svelte/tests/runtime-runes/samples/bindable-props-cleanup-no-setter/main.svelte delete mode 100644 packages/svelte/tests/runtime-runes/samples/bindable-props-cleanup-with-setter/Component.svelte delete mode 100644 packages/svelte/tests/runtime-runes/samples/bindable-props-cleanup-with-setter/_config.js delete mode 100644 packages/svelte/tests/runtime-runes/samples/bindable-props-cleanup-with-setter/main.svelte delete mode 100644 packages/svelte/tests/runtime-runes/samples/regular-props-cleanup-old-value/Component.svelte delete mode 100644 packages/svelte/tests/runtime-runes/samples/regular-props-cleanup-old-value/_config.js delete mode 100644 packages/svelte/tests/runtime-runes/samples/regular-props-cleanup-old-value/main.svelte diff --git a/packages/svelte/tests/runtime-runes/samples/bindable-props-cleanup-no-setter/Component.svelte b/packages/svelte/tests/runtime-runes/samples/bindable-props-cleanup-no-setter/Component.svelte deleted file mode 100644 index 40d6b1c2fb..0000000000 --- a/packages/svelte/tests/runtime-runes/samples/bindable-props-cleanup-no-setter/Component.svelte +++ /dev/null @@ -1,11 +0,0 @@ - - -

Count: {count}

diff --git a/packages/svelte/tests/runtime-runes/samples/bindable-props-cleanup-no-setter/_config.js b/packages/svelte/tests/runtime-runes/samples/bindable-props-cleanup-no-setter/_config.js deleted file mode 100644 index 07ea5af153..0000000000 --- a/packages/svelte/tests/runtime-runes/samples/bindable-props-cleanup-no-setter/_config.js +++ /dev/null @@ -1,63 +0,0 @@ -import { flushSync } from 'svelte'; -import { test } from '../../test'; - -export default test({ - async test({ assert, logs, target }) { - /** @type {HTMLButtonElement | null} */ - const increment_btn = target.querySelector('#increment'); - /** @type {HTMLButtonElement | null} */ - const toggle_btn = target.querySelector('#toggle'); - - for (const p of target.querySelectorAll('p')) { - assert.equal(p.innerHTML, 'Count: 0'); - } - - // Click increment: count=1 - flushSync(() => { - increment_btn?.click(); - }); - - for (const p of target.querySelectorAll('p')) { - assert.equal(p.innerHTML, 'Count: 1'); - } - - // Click increment again: count=2, components with count < 2 should unmount and log old values - flushSync(() => { - increment_btn?.click(); - }); - - for (const p of target.querySelectorAll('p')) { - assert.equal(p.innerHTML, 'Count: 2'); - } - - // Toggle show to hide components that depend on show - flushSync(() => { - toggle_btn?.click(); - }); - - // Should log old values during cleanup from the six components guarded by `count < 2`: - // 1. Component with bind: "1 true" - // 2. Component with spread: "1 true" - // 3. Component with normal props: "1 true" - // 4. Runes dynamic component with bind: "1 true" - // 5. Runes dynamic component with spread: "1 true" - // 6. Runes dynamic component with normal props: "1 true" - // Then from the four components guarded by `show`: - // 7. Component with bind (show): "2 true" (old value of checked) - // 8. Runes dynamic component with bind (show): "2 true" - // 9. Runes dynamic component with spread (show): "2 true" - // 10. Runes dynamic component with normal props (show): "2 true" - assert.deepEqual(logs, [ - '1 true', - '1 true', - '1 true', - '1 true', - '1 true', - '1 true', - '2 true', - '2 true', - '2 true', - '2 true' - ]); - } -}); diff --git a/packages/svelte/tests/runtime-runes/samples/bindable-props-cleanup-no-setter/main.svelte b/packages/svelte/tests/runtime-runes/samples/bindable-props-cleanup-no-setter/main.svelte deleted file mode 100644 index 592c46ff42..0000000000 --- a/packages/svelte/tests/runtime-runes/samples/bindable-props-cleanup-no-setter/main.svelte +++ /dev/null @@ -1,52 +0,0 @@ - - - - - - -{#if count < 2} - -{/if} - - -{#if count < 2} - -{/if} - - -{#if count < 2} - -{/if} - - -{#if show} - -{/if} - - - - - - - - - - - - - - - - - - diff --git a/packages/svelte/tests/runtime-runes/samples/bindable-props-cleanup-with-setter/Component.svelte b/packages/svelte/tests/runtime-runes/samples/bindable-props-cleanup-with-setter/Component.svelte deleted file mode 100644 index cc47017946..0000000000 --- a/packages/svelte/tests/runtime-runes/samples/bindable-props-cleanup-with-setter/Component.svelte +++ /dev/null @@ -1,14 +0,0 @@ - - -

Count: {count}

- - - diff --git a/packages/svelte/tests/runtime-runes/samples/bindable-props-cleanup-with-setter/_config.js b/packages/svelte/tests/runtime-runes/samples/bindable-props-cleanup-with-setter/_config.js deleted file mode 100644 index 07ea5af153..0000000000 --- a/packages/svelte/tests/runtime-runes/samples/bindable-props-cleanup-with-setter/_config.js +++ /dev/null @@ -1,63 +0,0 @@ -import { flushSync } from 'svelte'; -import { test } from '../../test'; - -export default test({ - async test({ assert, logs, target }) { - /** @type {HTMLButtonElement | null} */ - const increment_btn = target.querySelector('#increment'); - /** @type {HTMLButtonElement | null} */ - const toggle_btn = target.querySelector('#toggle'); - - for (const p of target.querySelectorAll('p')) { - assert.equal(p.innerHTML, 'Count: 0'); - } - - // Click increment: count=1 - flushSync(() => { - increment_btn?.click(); - }); - - for (const p of target.querySelectorAll('p')) { - assert.equal(p.innerHTML, 'Count: 1'); - } - - // Click increment again: count=2, components with count < 2 should unmount and log old values - flushSync(() => { - increment_btn?.click(); - }); - - for (const p of target.querySelectorAll('p')) { - assert.equal(p.innerHTML, 'Count: 2'); - } - - // Toggle show to hide components that depend on show - flushSync(() => { - toggle_btn?.click(); - }); - - // Should log old values during cleanup from the six components guarded by `count < 2`: - // 1. Component with bind: "1 true" - // 2. Component with spread: "1 true" - // 3. Component with normal props: "1 true" - // 4. Runes dynamic component with bind: "1 true" - // 5. Runes dynamic component with spread: "1 true" - // 6. Runes dynamic component with normal props: "1 true" - // Then from the four components guarded by `show`: - // 7. Component with bind (show): "2 true" (old value of checked) - // 8. Runes dynamic component with bind (show): "2 true" - // 9. Runes dynamic component with spread (show): "2 true" - // 10. Runes dynamic component with normal props (show): "2 true" - assert.deepEqual(logs, [ - '1 true', - '1 true', - '1 true', - '1 true', - '1 true', - '1 true', - '2 true', - '2 true', - '2 true', - '2 true' - ]); - } -}); diff --git a/packages/svelte/tests/runtime-runes/samples/bindable-props-cleanup-with-setter/main.svelte b/packages/svelte/tests/runtime-runes/samples/bindable-props-cleanup-with-setter/main.svelte deleted file mode 100644 index 592c46ff42..0000000000 --- a/packages/svelte/tests/runtime-runes/samples/bindable-props-cleanup-with-setter/main.svelte +++ /dev/null @@ -1,52 +0,0 @@ - - - - - - -{#if count < 2} - -{/if} - - -{#if count < 2} - -{/if} - - -{#if count < 2} - -{/if} - - -{#if show} - -{/if} - - - - - - - - - - - - - - - - - - diff --git a/packages/svelte/tests/runtime-runes/samples/regular-props-cleanup-old-value/Component.svelte b/packages/svelte/tests/runtime-runes/samples/regular-props-cleanup-old-value/Component.svelte deleted file mode 100644 index 1a95f1edf5..0000000000 --- a/packages/svelte/tests/runtime-runes/samples/regular-props-cleanup-old-value/Component.svelte +++ /dev/null @@ -1,11 +0,0 @@ - - -

Count: {count}

diff --git a/packages/svelte/tests/runtime-runes/samples/regular-props-cleanup-old-value/_config.js b/packages/svelte/tests/runtime-runes/samples/regular-props-cleanup-old-value/_config.js deleted file mode 100644 index 3d73bfd1a9..0000000000 --- a/packages/svelte/tests/runtime-runes/samples/regular-props-cleanup-old-value/_config.js +++ /dev/null @@ -1,49 +0,0 @@ -import { flushSync } from 'svelte'; -import { test } from '../../test'; - -export default test({ - async test({ assert, logs, target }) { - /** @type {HTMLButtonElement | null} */ - const increment_btn = target.querySelector('#increment'); - /** @type {HTMLButtonElement | null} */ - const toggle_btn = target.querySelector('#toggle'); - - for (const p of target.querySelectorAll('p')) { - assert.equal(p.innerHTML, 'Count: 0'); - } - - // Click increment: count=1 - flushSync(() => { - increment_btn?.click(); - }); - - for (const p of target.querySelectorAll('p')) { - assert.equal(p.innerHTML, 'Count: 1'); - } - - // Click increment again: count=2, components with count < 2 should unmount and log old values - flushSync(() => { - increment_btn?.click(); - }); - - for (const p of target.querySelectorAll('p')) { - assert.equal(p.innerHTML, 'Count: 2'); - } - - // Toggle show to hide components that depend on show - flushSync(() => { - toggle_btn?.click(); - }); - - // Should log old values during cleanup from the four components guarded by `count < 2`: - // 1. Component with normal props: "1 true" - // 2. Component with spread: "1 true" - // 3. Runes dynamic component with normal props: "1 true" - // 4. Runes dynamic component with spread: "1 true" - // Then from the three components guarded by `show`: - // 5. Component with normal props (show): "2 true" (old value of checked) - // 6. Runes dynamic component with normal props (show): "2 true" - // 7. Runes dynamic component with spread (show): "2 true" - assert.deepEqual(logs, ['1 true', '1 true', '1 true', '1 true', '2 true', '2 true', '2 true']); - } -}); diff --git a/packages/svelte/tests/runtime-runes/samples/regular-props-cleanup-old-value/main.svelte b/packages/svelte/tests/runtime-runes/samples/regular-props-cleanup-old-value/main.svelte deleted file mode 100644 index 8bc6abfa4d..0000000000 --- a/packages/svelte/tests/runtime-runes/samples/regular-props-cleanup-old-value/main.svelte +++ /dev/null @@ -1,41 +0,0 @@ - - - - - - -{#if count < 2} - -{/if} - - -{#if count < 2} - -{/if} - - -{#if show} - -{/if} - - - - - - - - - - - -