@@ -29,23 +29,18 @@ describe("CliUtils", () => {
2929 expect ( ( await cliUtils . stat ( binPath ) ) ?. size ) . toBe ( 4 ) ;
3030 } ) ;
3131
32- it ( "version" , async ( ) => {
33- const binPath = path . join ( tmp , isWindows ? "version.cmd" : "version" ) ;
32+ it . skipIf ( isWindows ) ( "version" , async ( ) => {
33+ const binPath = path . join ( tmp , "version" ) ;
3434 await expect ( cliUtils . version ( binPath ) ) . rejects . toThrow ( "ENOENT" ) ;
3535
3636 const binTmpl = await fs . readFile (
37- getFixturePath ( "scripts" , isWindows ? "bin.cmd" : "bin.bash" ) ,
37+ getFixturePath ( "scripts" , "bin.bash" ) ,
3838 "utf8" ,
3939 ) ;
40-
4140 await fs . writeFile ( binPath , binTmpl . replace ( "$ECHO" , "hello" ) ) ;
41+ await expect ( cliUtils . version ( binPath ) ) . rejects . toThrow ( "EACCES" ) ;
4242
43- if ( ! isWindows ) {
44- // EACCES test only makes sense on Unix
45- await expect ( cliUtils . version ( binPath ) ) . rejects . toThrow ( "EACCES" ) ;
46- await fs . chmod ( binPath , "755" ) ;
47- }
48-
43+ await fs . chmod ( binPath , "755" ) ;
4944 await expect ( cliUtils . version ( binPath ) ) . rejects . toThrow ( "Unexpected token" ) ;
5045
5146 await fs . writeFile ( binPath , binTmpl . replace ( "$ECHO" , "{}" ) ) ;
@@ -65,7 +60,7 @@ describe("CliUtils", () => {
6560 expect ( await cliUtils . version ( binPath ) ) . toBe ( "v0.0.0" ) ;
6661
6762 const oldTmpl = await fs . readFile (
68- getFixturePath ( "scripts" , isWindows ? "bin.old.cmd" : "bin.old.bash" ) ,
63+ getFixturePath ( "scripts" , "bin.old.bash" ) ,
6964 "utf8" ,
7065 ) ;
7166 const old = ( stderr : string , stdout : string ) : string => {
0 commit comments