@@ -18,8 +18,8 @@ describe('Manifest Json | configure hook', function() {
18
18
}
19
19
} )
20
20
21
- describe ( 'required config' , function ( ) {
22
- it ( 'warns about missing config props ' , function ( ) {
21
+ describe ( 'default config' , function ( ) {
22
+ it ( 'provides some default values ' , function ( ) {
23
23
let instance = subject . createDeployPlugin ( {
24
24
name : 'manifest-json'
25
25
} )
@@ -32,44 +32,35 @@ describe('Manifest Json | configure hook', function() {
32
32
}
33
33
34
34
instance . beforeHook ( context )
35
+ instance . configure ( context )
35
36
36
- assert . throws ( function ( ) {
37
- instance . configure ( context )
38
- } )
39
-
40
- let s = 'Missing required config: `isInNeedOfSleep`'
41
- assert . match ( mockUi . messages . pop ( ) , new RegExp ( s ) )
42
- } )
43
- } )
44
-
45
- describe ( 'default config' , function ( ) {
46
- let config
47
-
48
- beforeEach ( function ( ) {
49
- config = {
50
- isInNeedOfSleep : true ,
51
- meaningOfLife : 99
52
- }
37
+ assert . ok ( instance . readConfig ( 'filePattern' ) )
38
+ assert . equal ( instance . readConfig ( 'fileIgnorePattern' ) , null )
39
+ assert . ok ( instance . readConfig ( 'indexPath' ) )
53
40
} )
54
41
55
- it ( 'provides default meaning of life ' , function ( ) {
42
+ it ( 'has overridable default values ' , function ( ) {
56
43
let instance = subject . createDeployPlugin ( {
57
44
name : 'manifest-json'
58
45
} )
59
46
60
- delete config . meaningOfLife
61
-
62
47
let context = {
63
48
ui : mockUi ,
64
49
config : {
65
- 'manifest-json' : config
50
+ 'manifest-json' : {
51
+ filePattern : '**/*' ,
52
+ fileIgnorePattern : 'nope' ,
53
+ indexPath : 'index.json'
54
+ }
66
55
}
67
56
}
68
57
69
58
instance . beforeHook ( context )
70
59
instance . configure ( context )
71
60
72
- assert . equal ( instance . readConfig ( 'meaningOfLife' ) , 42 )
61
+ assert . ok ( instance . readConfig ( 'filePattern' ) , '**/*' )
62
+ assert . ok ( instance . readConfig ( 'fileIgnorePattern' ) , 'nope' )
63
+ assert . ok ( instance . readConfig ( 'indexPath' ) , 'index.json' )
73
64
} )
74
65
} )
75
66
} )
0 commit comments