From 658fde91a6883e6403b47a3346ae80088b3d515a Mon Sep 17 00:00:00 2001 From: btea <2356281422@qq.com> Date: Wed, 11 Jun 2025 21:10:30 +0800 Subject: [PATCH] ci: use Nodejs 24 (#7999) --- .github/workflows/ci.yml | 2 +- test/cli/test/config-loader.test.ts | 13 +++++++++++-- 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 67a0316cd..41b2494af 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -83,7 +83,7 @@ jobs: strategy: matrix: os: [ubuntu-latest] - node_version: [18, 20, 22] + node_version: [18, 20, 22, 24] include: - os: macos-latest node_version: 20 diff --git a/test/cli/test/config-loader.test.ts b/test/cli/test/config-loader.test.ts index 1a5f85b32..dc1ad4675 100644 --- a/test/cli/test/config-loader.test.ts +++ b/test/cli/test/config-loader.test.ts @@ -1,14 +1,23 @@ import { expect, test } from 'vitest' import { runVitestCli } from '../../test-utils' +const [nvMajor, nvMinor] = process.versions.node.split('.').map(Number) +const isTypeStrippingSupported + = (nvMajor === 23 && nvMinor >= 6) || nvMajor >= 24 + test('configLoader default', async () => { const { vitest, exitCode } = await runVitestCli( 'run', '--root', 'fixtures/config-loader', ) - expect(vitest.stderr).toContain('failed to load config') - expect(exitCode).not.toBe(0) + if (!isTypeStrippingSupported) { + expect(vitest.stderr).toContain('failed to load config') + expect(exitCode).not.toBe(0) + } + else { + expect(exitCode).toBe(0) + } }) test('configLoader runner', async () => { -- 2.51.2