File tree Expand file tree Collapse file tree 1 file changed +11
-0
lines changed Expand file tree Collapse file tree 1 file changed +11
-0
lines changed Original file line number Diff line number Diff line change @@ -145,6 +145,17 @@ beforeAll(
145
145
if ( fs . existsSync ( logsDir ) ) {
146
146
fs . rmSync ( logsDir , { recursive : true , force : true } ) ;
147
147
}
148
+ // remove strip types flag for node < 22, it doesn't work there
149
+ // TODO: remove once node20 is no longer part of CI
150
+ if ( Number ( process . versions . node ?. split ( '.' , 1 ) [ 0 ] ) < 22 ) {
151
+ const pkgFile = path . join ( tempDir , 'package.json' ) ;
152
+ const pkgContent = fs . readFileSync ( pkgFile , 'utf-8' ) ;
153
+ const newContent = pkgContent . replaceAll (
154
+ 'cross-env NODE_OPTIONS=\\"--experimental-strip-types\\" ' ,
155
+ ''
156
+ ) ;
157
+ fs . writeFileSync ( pkgFile , newContent , 'utf-8' ) ;
158
+ }
148
159
await fs . mkdir ( logsDir ) ;
149
160
const customServerScript = path . resolve ( path . dirname ( testPath ) , 'serve.js' ) ;
150
161
const defaultServerScript = path . resolve ( e2eTestsRoot , 'e2e-server.js' ) ;
You can’t perform that action at this time.
0 commit comments