@@ -11,6 +11,7 @@ const messagesByScope = {
11
11
multiple : {
12
12
multiple : 'foo(bar,baz): qux' ,
13
13
multipleCommaSpace : 'foo(bar, baz): qux' ,
14
+ multipleSlash : 'foo(bar/baz): qux' ,
14
15
} ,
15
16
none : {
16
17
empty : 'foo: baz' ,
@@ -143,6 +144,16 @@ describe('Scope Enum Validation', () => {
143
144
expect ( message ) . toEqual ( 'scope must be one of [bar]' ) ;
144
145
} ) ;
145
146
} ) ;
147
+
148
+ test ( `Succeeds with a 'multipleSlash' message when the scopes are included in enum` , async ( ) => {
149
+ const [ actual , message ] = scopeEnum (
150
+ await parse ( messages [ 'multipleSlash' ] ) ,
151
+ 'always' ,
152
+ [ 'bar/baz' ]
153
+ ) ;
154
+ expect ( actual ) . toBeTruthy ( ) ;
155
+ expect ( message ) . toEqual ( 'scope must be one of [bar/baz]' ) ;
156
+ } ) ;
146
157
} ) ;
147
158
} ) ;
148
159
@@ -181,6 +192,16 @@ describe('Scope Enum Validation', () => {
181
192
expect ( message ) . toEqual ( 'scope must not be one of [bar, baz]' ) ;
182
193
} ) ;
183
194
} ) ;
195
+
196
+ test ( `Fails with a 'multipleSlash' message when the scopes are included in enum` , async ( ) => {
197
+ const [ actual , message ] = scopeEnum (
198
+ await parse ( messages [ 'multipleSlash' ] ) ,
199
+ 'never' ,
200
+ [ 'bar/baz' ]
201
+ ) ;
202
+ expect ( actual ) . toBeFalsy ( ) ;
203
+ expect ( message ) . toEqual ( 'scope must not be one of [bar/baz]' ) ;
204
+ } ) ;
184
205
} ) ;
185
206
} ) ;
186
207
} ) ;
0 commit comments