22const fs = require ( 'fs' ) ;
33const path = require ( 'path' ) ;
44const assert = require ( 'assert' ) ;
5- const shell = require ( 'shelljs ' ) ;
5+ const spawn = require ( 'cross-spawn ' ) ;
66const Environment = require ( '../lib/environment' ) ;
77
88const globalLookupTest = process . env . NODE_PATH ? it : xit ;
@@ -17,9 +17,9 @@ describe('Environment Resolver', function () {
1717 before ( function ( ) {
1818 this . projectRoot = path . join ( __dirname , 'fixtures/lookup-project' ) ;
1919 process . chdir ( this . projectRoot ) ;
20- shell . exec ( 'npm install --no-package-lock' , { silent : true } ) ;
21- shell . exec ( 'npm install generator-jquery --no-package-lock' , { silent : true } ) ;
22- shell . exec ( 'npm install -g generator-dummytest generator-dummy --no-package-lock' , { silent : true } ) ;
20+ spawn . sync ( 'npm' , [ ' install' , ' --no-package-lock'] ) ;
21+ spawn . sync ( 'npm' , [ ' install' , ' generator-jquery' , ' --no-package-lock'] ) ;
22+ spawn . sync ( 'npm' , [ ' install' , '-g' , ' generator-dummytest' , ' generator-dummy' , ' --no-package-lock'] ) ;
2323
2424 fs . symlinkSync (
2525 path . resolve ( '../generator-extend' ) ,
@@ -87,7 +87,7 @@ describe('Environment Resolver', function () {
8787 before ( function ( ) {
8888 this . projectSubRoot = path . join ( this . projectRoot , 'subdir' ) ;
8989 process . chdir ( this . projectSubRoot ) ;
90- shell . exec ( 'npm install --no-package-lock' , { silent : true } ) ;
90+ spawn . sync ( 'npm' , [ ' install' , ' --no-package-lock'] ) ;
9191 } ) ;
9292
9393 beforeEach ( function ( ) {
0 commit comments