From 5ac4ae44650f04d83b7649a2c2ae3e51d90bec59 Mon Sep 17 00:00:00 2001 From: baseballyama Date: Sat, 6 Sep 2025 15:21:21 +0900 Subject: [PATCH] try to check node version --- packages/svelte/tests/runtime-legacy/shared.ts | 8 ++++++++ .../tests/runtime-runes/samples/pre-effect/_config.js | 1 + 2 files changed, 9 insertions(+) diff --git a/packages/svelte/tests/runtime-legacy/shared.ts b/packages/svelte/tests/runtime-legacy/shared.ts index 05c1a982ec..2e16b80512 100644 --- a/packages/svelte/tests/runtime-legacy/shared.ts +++ b/packages/svelte/tests/runtime-legacy/shared.ts @@ -13,6 +13,8 @@ import type { CompileOptions } from '#compiler'; import { suite_with_variants, type BaseTest } from '../suite.js'; import { clear } from '../../src/internal/client/reactivity/batch.js'; +const NODE_MAJOR_VERSION = parseInt(process.version.split('.')[0].slice(1)); + type Assert = typeof import('vitest').assert & { htmlEqual(a: string, b: string, description?: string): void; htmlEqualWithOptions( @@ -95,6 +97,7 @@ export interface RuntimeTest = Record( ['dom', 'hydrate', 'ssr'], (variant, config, test_name) => { + if (config.requiredNodeVersion && NODE_MAJOR_VERSION < config.requiredNodeVersion) { + return true; + } + + if (!async_mode && (config.skip_no_async || test_name.startsWith('async-'))) { return true; } diff --git a/packages/svelte/tests/runtime-runes/samples/pre-effect/_config.js b/packages/svelte/tests/runtime-runes/samples/pre-effect/_config.js index c836a2e593..8792a88e62 100644 --- a/packages/svelte/tests/runtime-runes/samples/pre-effect/_config.js +++ b/packages/svelte/tests/runtime-runes/samples/pre-effect/_config.js @@ -2,6 +2,7 @@ import { flushSync } from 'svelte'; import { test } from '../../test'; export default test({ + requiredNodeVersion: 24, test({ assert, target, logs }) { const [b1, b2] = target.querySelectorAll('button'); b1.click();