11import { loadPartialConfigSync } from "../lib/index.js" ;
22import path from "path" ;
33import semver from "semver" ;
4- import { USE_ESM , commonJS } from "$repo-utils" ;
4+ import { USE_ESM , commonJS , itLt } from "$repo-utils" ;
55
66const { __dirname, require } = commonJS ( import . meta. url ) ;
77
@@ -11,6 +11,9 @@ const { __dirname, require } = commonJS(import.meta.url);
1111// TODO: Make it work with USE_ESM.
1212const shouldSkip = semver . lt ( process . version , "14.0.0" ) || USE_ESM ;
1313
14+ // Node.js 23.6 unflags --experimental-strip-types
15+ const nodeLt23_6 = itLt ( "23.6.0" ) ;
16+
1417( shouldSkip ? describe : describe . skip ) (
1518 "@babel/core config with ts [dummy]" ,
1619 ( ) => {
@@ -38,7 +41,9 @@ const shouldSkip = semver.lt(process.version, "14.0.0") || USE_ESM;
3841 expect ( config . options . sourceRoot ) . toMatchInlineSnapshot ( `"/a/b"` ) ;
3942 } ) ;
4043
41- it ( "should throw with invalid .ts register" , ( ) => {
44+ // Node.js >=23.6 has builtin .ts register, so this test can be removed
45+ // when we dropped Node.js 23 support in the future
46+ nodeLt23_6 ( "should throw with invalid .ts register" , ( ) => {
4247 require . extensions [ ".ts" ] = ( ) => {
4348 throw new Error ( "Not support .ts." ) ;
4449 } ;
0 commit comments