@@ -6,6 +6,7 @@ import { fileURLToPath } from 'node:url';
6
6
7
7
const __dirname = dirname ( fileURLToPath ( import . meta. url ) ) ;
8
8
const require = createRequire ( import . meta. url ) ;
9
+ const env = { ...process . env , NODE_OPTIONS : "--no-deprecation" } ;
9
10
10
11
function prepareTest ( root ) {
11
12
const pkgJson = require ( '../package.json' ) ;
@@ -27,10 +28,10 @@ function prepareTest(root) {
27
28
rmSync ( join ( root , 'yarn.lock' ) , { force : true } ) ;
28
29
29
30
console . log ( 'Clearing yarn cache...' ) ;
30
- spawnSync ( `yarn cache clean ${ pkgJson . name } ` , { shell : true , stdio : 'inherit' } ) ;
31
+ spawnSync ( `yarn cache clean ${ pkgJson . name } ` , { shell : true , stdio : 'inherit' , env } ) ;
31
32
// Yarn has a bug where 'yarn cache clean X' does not remove the temp directory where the tgz is unpacked to.
32
33
// This means installing from local tgz does not update when src changes are made https://github.com/yarnpkg/yarn/issues/5357
33
- const dirResult = spawnSync ( 'yarn cache dir' , { shell : true } ) ;
34
+ const dirResult = spawnSync ( 'yarn cache dir' , { shell : true , env } ) ;
34
35
const tmpDir = join ( dirResult . output . toString ( ) . replace ( / [ , \n \r ] / g, '' ) , '.tmp' ) ;
35
36
rmSync ( tmpDir , { recursive : true , force : true } ) ;
36
37
0 commit comments