@@ -93,14 +93,14 @@ describe(`EnableCommand`, () => {
9393 await xfs . writeFilePromise ( ppath . join ( cwd , `yarn` ) , `hello` ) ;
9494
9595 process . env . PATH = `${ npath . fromPortablePath ( cwd ) } ${ delimiter } ${ process . env . PATH } ` ;
96- await expect ( runCli ( cwd , [ `enable` ] ) ) . resolves . toMatchObject ( {
96+ await expect ( runCli ( cwd , [ `enable` , `--install-directory` , npath . fromPortablePath ( cwd ) ] ) ) . resolves . toMatchObject ( {
9797 stdout : `` ,
9898 stderr : `` ,
9999 exitCode : 0 ,
100100 } ) ;
101101
102102 const file = await xfs . readFilePromise ( ppath . join ( cwd , `yarn` ) , `utf8` ) ;
103- expect ( file ) . toBe ( `hello` ) ;
103+ expect ( file ) . not . toBe ( `hello` ) ;
104104 } ) ;
105105 } ) ;
106106
@@ -109,15 +109,15 @@ describe(`EnableCommand`, () => {
109109 await xfs . mkdirPromise ( ppath . join ( cwd , `switch/bin` ) , { recursive : true } ) ;
110110 await xfs . writeFilePromise ( ppath . join ( cwd , `switch/bin/yarn` ) , `hello` ) ;
111111
112- await xfs . linkPromise (
112+ await xfs . symlinkPromise (
113113 ppath . join ( cwd , `switch/bin/yarn` ) ,
114114 ppath . join ( cwd , `yarn` ) ,
115115 ) ;
116116
117117 process . env . PATH = `${ npath . fromPortablePath ( cwd ) } ${ delimiter } ${ process . env . PATH } ` ;
118- await expect ( runCli ( cwd , [ `enable` ] ) ) . resolves . toMatchObject ( {
118+ await expect ( runCli ( cwd , [ `enable` , `--install-directory` , npath . fromPortablePath ( cwd ) ] ) ) . resolves . toMatchObject ( {
119119 stdout : `` ,
120- stderr : `` ,
120+ stderr : expect . stringMatching ( / ^ y a r n i s a l r e a d y i n s t a l l e d i n . + a n d p o i n t s t o a Y a r n S w i t c h i n s t a l l - s k i p p i n g \n $ / ) ,
121121 exitCode : 0 ,
122122 } ) ;
123123
0 commit comments