Skip to content

ci: run tests on Node 24 as well #20049

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
May 19, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ jobs:
strategy:
matrix:
os: [ubuntu-latest]
node_version: [20, 22]
node_version: [20, 22, 24]
include:
# Active LTS + other OS
- os: macos-latest
Expand Down
24 changes: 15 additions & 9 deletions packages/vite/src/node/__tests__/runnerImport.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@ import { loadConfigFromFile } from 'vite'
import { runnerImport } from '../ssr/runnerImport'
import { slash } from '../../shared/utils'

const [nvMajor, nvMinor] = process.versions.node.split('.').map(Number)
const isTypeStrippingSupported =
(nvMajor === 23 && nvMinor >= 6) || nvMajor >= 24

describe('importing files using inlined environment', () => {
const fixture = (name: string) =>
resolve(import.meta.dirname, './fixtures/runner-import', name)
Expand Down Expand Up @@ -51,15 +55,17 @@ describe('importing files using inlined environment', () => {
])

// confirm that it fails with a bundle approach
await expect(async () => {
const root = resolve(import.meta.dirname, './fixtures/runner-import')
await loadConfigFromFile(
{ mode: 'production', command: 'serve' },
resolve(root, './vite.config.outside-pkg-import.mts'),
root,
'silent',
)
}).rejects.toThrow('Unknown file extension ".ts"')
if (!isTypeStrippingSupported) {
await expect(async () => {
const root = resolve(import.meta.dirname, './fixtures/runner-import')
await loadConfigFromFile(
{ mode: 'production', command: 'serve' },
resolve(root, './vite.config.outside-pkg-import.mts'),
root,
'silent',
)
}).rejects.toThrow('Unknown file extension ".ts"')
}
})

test('dynamic import', async () => {
Expand Down