@@ -30,8 +30,9 @@ describe('install', () => {
30
30
31
31
try {
32
32
const { stdout } = await spawn ( 'node' , [ bin , '-u' , '--packageFile' , pkgFile ] )
33
- stripAnsi ( stdout ) . should . include ( ' Run npm install to install new versions' )
33
+ stripAnsi ( stdout ) . should . match ( / R u n ( n p m | y a r n ) i n s t a l l t o i n s t a l l n e w v e r s i o n s / )
34
34
expect ( await exists ( path . join ( tempDir , 'package-lock.json' ) ) ) . to . be . false
35
+ expect ( await exists ( path . join ( tempDir , 'yarn.lock' ) ) ) . to . be . false
35
36
expect ( await exists ( path . join ( tempDir , 'node_modules' ) ) ) . to . be . false
36
37
} finally {
37
38
await fs . rm ( tempDir , { recursive : true , force : true } )
@@ -54,7 +55,7 @@ describe('install', () => {
54
55
55
56
try {
56
57
const { stdout } = await spawn ( 'node' , [ bin , '-u' , '--packageFile' , pkgFile , '--install' , 'always' ] )
57
- stripAnsi ( stdout ) . should . not . include ( ' Run npm install to install new versions' )
58
+ stripAnsi ( stdout ) . should . not . match ( / R u n ( n p m | y a r n ) i n s t a l l t o i n s t a l l n e w v e r s i o n s / )
58
59
expect ( await exists ( path . join ( tempDir , 'package-lock.json' ) ) ) . to . be . true
59
60
expect ( await exists ( path . join ( tempDir , 'node_modules' ) ) ) . to . be . true
60
61
} finally {
@@ -78,8 +79,9 @@ describe('install', () => {
78
79
79
80
try {
80
81
const { stdout } = await spawn ( 'node' , [ bin , '-u' , '--packageFile' , pkgFile , '--install' , 'never' ] )
81
- stripAnsi ( stdout ) . should . not . include ( ' Run npm install to install new versions' )
82
+ stripAnsi ( stdout ) . should . not . match ( / R u n ( n p m | y a r n ) i n s t a l l t o i n s t a l l n e w v e r s i o n s / )
82
83
expect ( await exists ( path . join ( tempDir , 'package-lock.json' ) ) ) . to . be . false
84
+ expect ( await exists ( path . join ( tempDir , 'yarn.lock' ) ) ) . to . be . false
83
85
expect ( await exists ( path . join ( tempDir , 'node_modules' ) ) ) . to . be . false
84
86
} finally {
85
87
await fs . rm ( tempDir , { recursive : true , force : true } )
0 commit comments