@@ -61,13 +61,13 @@ const lonelyFilePath = path.join(
6161 'lonely-file.txt'
6262)
6363
64+ const hiddenFile = path . join ( root , '.hidden-file.txt' )
6465const fileInHiddenFolderPath = path . join (
6566 root ,
6667 '.hidden-folder' ,
6768 'folder-in-hidden-folder' ,
6869 'file.txt'
6970)
70- const hiddenFile = path . join ( root , '.hidden-file.txt' )
7171const fileInHiddenFolderInFolderA = path . join (
7272 root ,
7373 'folder-a' ,
@@ -132,6 +132,10 @@ describe('Search', () => {
132132 await fs . writeFile ( amazingFileInFolderHPath , 'amazing file' )
133133
134134 await fs . writeFile ( lonelyFilePath , 'all by itself' )
135+
136+ await fs . writeFile ( hiddenFile , 'hidden file' )
137+ await fs . writeFile ( fileInHiddenFolderPath , 'file in hidden directory' )
138+ await fs . writeFile ( fileInHiddenFolderInFolderA , 'file in hidden directory' )
135139 /*
136140 Directory structure of files that get created:
137141 root/
@@ -385,25 +389,19 @@ describe('Search', () => {
385389 const searchPath = path . join ( root , '**/*' )
386390 const searchResult = await findFilesToUpload ( searchPath )
387391
388- expect ( searchResult . filesToUpload . includes ( hiddenFile ) ) . toEqual ( false )
389- expect ( searchResult . filesToUpload . includes ( fileInHiddenFolderPath ) ) . toEqual (
390- false
392+ expect ( searchResult . filesToUpload ) . not . toContain ( hiddenFile )
393+ expect ( searchResult . filesToUpload ) . not . toContain ( fileInHiddenFolderPath )
394+ expect ( searchResult . filesToUpload ) . not . toContain (
395+ fileInHiddenFolderInFolderA
391396 )
392- expect (
393- searchResult . filesToUpload . includes ( fileInHiddenFolderInFolderA )
394- ) . toEqual ( false )
395397 } )
396398
397399 it ( 'Hidden files included' , async ( ) => {
398400 const searchPath = path . join ( root , '**/*' )
399401 const searchResult = await findFilesToUpload ( searchPath , true )
400402
401- expect ( searchResult . filesToUpload . includes ( hiddenFile ) ) . toEqual ( false )
402- expect ( searchResult . filesToUpload . includes ( fileInHiddenFolderPath ) ) . toEqual (
403- false
404- )
405- expect (
406- searchResult . filesToUpload . includes ( fileInHiddenFolderInFolderA )
407- ) . toEqual ( false )
403+ expect ( searchResult . filesToUpload ) . toContain ( hiddenFile )
404+ expect ( searchResult . filesToUpload ) . toContain ( fileInHiddenFolderPath )
405+ expect ( searchResult . filesToUpload ) . toContain ( fileInHiddenFolderInFolderA )
408406 } )
409407} )
0 commit comments