@@ -12,30 +12,43 @@ const __dirname = fileURLToPath(new URL('.', import.meta.url))
12
12
sinon . stub ( core , 'info' )
13
13
sinon . stub ( core , 'debug' )
14
14
15
- const workspace = join ( __dirname , 'fixtures' )
15
+ const workspace = join ( __dirname , 'fixtures/files ' )
16
16
17
- test ( 'lists files' , async assert => {
17
+ test ( 'lists all files' , async assert => {
18
18
assert . plan ( 3 )
19
19
20
20
const options = { files : [ ] }
21
21
22
22
const contents = await files ( workspace , options )
23
23
24
+ assert . same ( core . info . lastCall . args , [ 'found 3 files available to sync' ] )
25
+ assert . same ( core . debug . lastCall . args , [ inspect ( [ 'file.1' , 'file.2' , 'file.3' ] ) ] )
26
+
27
+ assert . equal ( contents . size , 3 )
28
+ } )
29
+
30
+ test ( 'lists specific files' , async assert => {
31
+ assert . plan ( 3 )
32
+
33
+ const options = { files : [ '!file.3' ] }
34
+
35
+ const contents = await files ( workspace , options )
36
+
24
37
assert . same ( core . info . lastCall . args , [ 'found 2 files available to sync' ] )
25
- assert . same ( core . debug . lastCall . args , [ inspect ( [ 'invalid.yml ' , 'valid.yml ' ] ) ] )
38
+ assert . same ( core . debug . lastCall . args , [ inspect ( [ 'file.1 ' , 'file.2 ' ] ) ] )
26
39
27
40
assert . equal ( contents . size , 2 )
28
41
} )
29
42
30
43
test ( 'lists remapped files' , async assert => {
31
44
assert . plan ( 3 )
32
45
33
- const options = { files : [ { 'valid.yml ' : '/new/path/new.name' } ] }
46
+ const options = { files : [ { 'file.1 ' : '/new/path/new.name' } ] }
34
47
35
48
const contents = await files ( workspace , options )
36
49
37
- assert . same ( core . info . lastCall . args , [ 'found 2 files available to sync' ] )
38
- assert . same ( core . debug . lastCall . args , [ inspect ( [ '/new/path/new.name' , 'invalid.yml ' ] ) ] )
50
+ assert . same ( core . info . lastCall . args , [ 'found 3 files available to sync' ] )
51
+ assert . same ( core . debug . lastCall . args , [ inspect ( [ '/new/path/new.name' , 'file.2' , 'file.3 '] ) ] )
39
52
40
- assert . equal ( contents . size , 2 )
53
+ assert . equal ( contents . size , 3 )
41
54
} )
0 commit comments