@@ -36,7 +36,7 @@ describe("tools", function() {
3636 assert . end ( )
3737 } )
3838
39- it ( "should list files: {0}" , [
39+ if ( process . platform === "linux" ) it ( "should list files: {0}" , [
4040 "test/index.js" ,
4141 "*.js" ,
4242 "test/data/**/*" ,
@@ -54,21 +54,20 @@ describe("tools", function() {
5454 cli . mkdirp ( ".github/.dot" )
5555 cli . cp ( "package.json" , ".github/.dot/p.json" )
5656 cli . cp ( ".github/.dot" , ".github/.dot2" )
57- assert . equal (
57+ if ( process . platform === "linux" ) assert . equal (
5858 cli . ls ( ".*/.d*" , null , ".github" ) . join ( " " ) ,
5959 child . execSync ( "bash -c 'shopt -s globstar;echo .github .*/.d*'" ) . toString ( "utf8" ) . trim ( )
6060 )
6161 // Assert options
6262 assert . equal ( cli . ls ( ".github/*" , { dir : false } ) . join ( " " ) , ".github/jshint.json .github/litejs.json" )
6363 assert . equal ( cli . ls ( "*" , { cwd : ".github" , dir : false } ) . join ( " " ) , "jshint.json litejs.json" )
64- assert . own ( cli . ls ( "*" , { cwd : ".github" , stat : true } ) . map ( s => ( { size : s . size , name : s . name } ) ) , [
65- { size : 232 , name : "jshint.json" } ,
66- { size : 268 , name : "litejs.json" } ,
67- { size : 4096 , name : "workflows" }
68- ] )
64+ var stats = cli . ls ( "*" , { cwd : ".github" , stat : true } ) . map ( s => ( { size : s . size , name : s . name } ) )
65+ assert . equal ( stats . length , 3 )
66+ assert . equal ( stats [ 0 ] . size , 232 )
67+ assert . equal ( stats [ 2 ] . name , "workflows" )
6968 assert . equal ( cli . ls ( ".github/*" , { file : false } ) . join ( " " ) , ".github/workflows" )
7069 assert . equal ( cli . ls ( ".github/*" , { file : false , root : "/www/" } ) . join ( " " ) , "/www/.github/workflows" )
71- assert . equal ( cli . ls ( ".github/*" , { file : false , absolute : true } ) . join ( " " ) , path . join ( process . cwd ( ) , ".github/workflows" ) )
70+ assert . equal ( cli . ls ( ".github/*" , { file : false , absolute : true } ) . join ( " " ) , path . join ( process . cwd ( ) , ".github/workflows" ) . replace ( / \\ / g , "/" ) )
7271 assert . equal ( cli . ls ( ".github/*" , { dot : true } ) . join ( " " ) , ".github/.dot .github/.dot2 .github/jshint.json .github/litejs.json .github/workflows" )
7372 cli . rmrf ( ".github/.dot" )
7473 cli . rmrf ( ".github/.dot2" )
0 commit comments