@@ -61,13 +61,13 @@ const lonelyFilePath = path.join(
61
61
'lonely-file.txt'
62
62
)
63
63
64
+ const hiddenFile = path . join ( root , '.hidden-file.txt' )
64
65
const fileInHiddenFolderPath = path . join (
65
66
root ,
66
67
'.hidden-folder' ,
67
68
'folder-in-hidden-folder' ,
68
69
'file.txt'
69
70
)
70
- const hiddenFile = path . join ( root , '.hidden-file.txt' )
71
71
const fileInHiddenFolderInFolderA = path . join (
72
72
root ,
73
73
'folder-a' ,
@@ -132,6 +132,10 @@ describe('Search', () => {
132
132
await fs . writeFile ( amazingFileInFolderHPath , 'amazing file' )
133
133
134
134
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' )
135
139
/*
136
140
Directory structure of files that get created:
137
141
root/
@@ -385,25 +389,19 @@ describe('Search', () => {
385
389
const searchPath = path . join ( root , '**/*' )
386
390
const searchResult = await findFilesToUpload ( searchPath )
387
391
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
391
396
)
392
- expect (
393
- searchResult . filesToUpload . includes ( fileInHiddenFolderInFolderA )
394
- ) . toEqual ( false )
395
397
} )
396
398
397
399
it ( 'Hidden files included' , async ( ) => {
398
400
const searchPath = path . join ( root , '**/*' )
399
401
const searchResult = await findFilesToUpload ( searchPath , true )
400
402
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 )
408
406
} )
409
407
} )
0 commit comments