Skip to content

Commit 143574a

Browse files
authored
test: conditionally skip config loader test on older Node.js versions (#4660)
1 parent 4828c30 commit 143574a

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

e2e/cases/cli/config-loader/index.test.ts

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,14 @@ import path from 'node:path';
33
import { globContentJSON, rspackOnlyTest } from '@e2e/helper';
44
import { expect } from '@playwright/test';
55

6-
rspackOnlyTest('should use Node.js native loader to load config', async () => {
6+
const nodeVersion = process.version.slice(1).split('.')[0];
7+
const isNodeVersionCompatible = Number(nodeVersion) >= 22;
8+
9+
const conditionalTest = isNodeVersionCompatible
10+
? rspackOnlyTest
11+
: rspackOnlyTest.skip;
12+
13+
conditionalTest('should use Node.js native loader to load config', async () => {
714
execSync('npx rsbuild build --config-loader native', {
815
cwd: __dirname,
916
env: {

0 commit comments

Comments
 (0)