@@ -22,27 +22,21 @@ after(function () {
22
22
fixture . forEach ( fs . unlinkSync . bind ( fs ) ) ;
23
23
} ) ;
24
24
25
- it ( 'should glob - async' , function ( cb ) {
26
- globby ( '*.tmp' , function ( err , paths ) {
27
- assert ( ! err , err ) ;
25
+ it ( 'should glob - async' , function ( ) {
26
+ return globby ( '*.tmp' ) . then ( function ( paths ) {
28
27
assert . deepEqual ( paths , [ 'a.tmp' , 'b.tmp' , 'c.tmp' , 'd.tmp' , 'e.tmp' ] ) ;
29
- cb ( ) ;
30
28
} ) ;
31
29
} ) ;
32
30
33
- it ( 'should glob with multiple patterns - async' , function ( cb ) {
34
- globby ( [ 'a.tmp' , '*.tmp' , '!{c,d,e}.tmp' ] , function ( err , paths ) {
35
- assert ( ! err , err ) ;
31
+ it ( 'should glob with multiple patterns - async' , function ( ) {
32
+ return globby ( [ 'a.tmp' , '*.tmp' , '!{c,d,e}.tmp' ] ) . then ( function ( paths ) {
36
33
assert . deepEqual ( paths , [ 'a.tmp' , 'b.tmp' ] ) ;
37
- cb ( ) ;
38
34
} ) ;
39
35
} ) ;
40
36
41
- it ( 'should respect patterns order - async' , function ( cb ) {
42
- globby ( [ '!*.tmp' , 'a.tmp' ] , function ( err , paths ) {
43
- assert ( ! err , err ) ;
37
+ it ( 'should respect patterns order - async' , function ( ) {
38
+ return globby ( [ '!*.tmp' , 'a.tmp' ] ) . then ( function ( paths ) {
44
39
assert . deepEqual ( paths , [ 'a.tmp' ] ) ;
45
- cb ( ) ;
46
40
} ) ;
47
41
} ) ;
48
42
@@ -52,18 +46,25 @@ it('should glob - sync', function () {
52
46
assert . deepEqual ( globby . sync ( [ '!*.tmp' , 'a.tmp' ] ) , [ 'a.tmp' ] ) ;
53
47
} ) ;
54
48
49
+ it ( 'should return [] for all negative patterns - sync' , function ( ) {
50
+ assert . deepEqual ( globby . sync ( [ '!a.tmp' , '!b.tmp' ] ) , [ ] ) ;
51
+ } )
52
+
53
+ it ( 'should return [] for all negative patterns - async' , function ( ) {
54
+ return globby ( [ '!a.tmp' , '!b.tmp' ] ) . then ( function ( paths ) {
55
+ assert . deepEqual ( paths , [ ] ) ;
56
+ } ) ;
57
+ } )
58
+
55
59
it ( 'cwd option' , function ( ) {
56
60
process . chdir ( 'tmp' ) ;
57
61
assert . deepEqual ( globby . sync ( '*.tmp' , { cwd : cwd } ) , [ 'a.tmp' , 'b.tmp' , 'c.tmp' , 'd.tmp' , 'e.tmp' ] ) ;
58
62
assert . deepEqual ( globby . sync ( [ 'a.tmp' , '*.tmp' , '!{c,d,e}.tmp' ] , { cwd : cwd } ) , [ 'a.tmp' , 'b.tmp' ] ) ;
59
63
process . chdir ( cwd ) ;
60
64
} ) ;
61
65
62
- it ( 'should not mutate the options object - async' , function ( cb ) {
63
- globby ( [ '*.tmp' , '!b.tmp' ] , Object . freeze ( { ignore : Object . freeze ( [ ] ) } ) , function ( err , paths ) {
64
- assert ( ! err , err ) ;
65
- cb ( ) ;
66
- } ) ;
66
+ it ( 'should not mutate the options object - async' , function ( ) {
67
+ return globby ( [ '*.tmp' , '!b.tmp' ] , Object . freeze ( { ignore : Object . freeze ( [ ] ) } ) ) ;
67
68
} ) ;
68
69
69
70
it ( 'should not mutate the options object - sync' , function ( ) {
0 commit comments