@@ -84,9 +84,9 @@ test('should retrieve routes with apigwToken and basepath', t => {
84
84
85
85
test ( 'get routes with incorrect parameters' , t => {
86
86
const routes = new Routes ( { options : { } } )
87
- t . throws ( ( ) => { routes . get ( ) } , / M i s s i n g m a n d a t o r y p a r a m e t e r s : b a s e p a t h o r n a m e / )
88
- t . throws ( ( ) => { routes . get ( { } ) } , / M i s s i n g m a n d a t o r y p a r a m e t e r s : b a s e p a t h o r n a m e / )
89
- t . throws ( ( ) => { routes . get ( { basepath : 'id' , name : 'id' } ) } , / I n v a l i d p a r a m e t e r s : u s e b a s e p a t h o r n a m e , n o t b o t h / )
87
+ t . throws ( ( ) => { routes . get ( ) } , { message : / M i s s i n g m a n d a t o r y p a r a m e t e r s : b a s e p a t h o r n a m e / } )
88
+ t . throws ( ( ) => { routes . get ( { } ) } , { message : / M i s s i n g m a n d a t o r y p a r a m e t e r s : b a s e p a t h o r n a m e / } )
89
+ t . throws ( ( ) => { routes . get ( { basepath : 'id' , name : 'id' } ) } , { message : / I n v a l i d p a r a m e t e r s : u s e b a s e p a t h o r n a m e , n o t b o t h / } )
90
90
} )
91
91
92
92
// OVERRIDE gateway package
@@ -172,7 +172,7 @@ test('list routes providing basepath and name', t => {
172
172
basepath : 'bp' ,
173
173
name : 'nm'
174
174
} )
175
- } , / I n v a l i d p a r a m e t e r s : u s e b a s e p a t h o r n a m e , n o t b o t h / )
175
+ } , { message : / I n v a l i d p a r a m e t e r s : u s e b a s e p a t h o r n a m e , n o t b o t h / } )
176
176
} )
177
177
178
178
test ( 'should delete a route with basepath' , t => {
@@ -242,7 +242,7 @@ test('should delete a route with parameters', t => {
242
242
test ( 'delete routes without providing basepath or name' , t => {
243
243
const client = { options : { } }
244
244
const routes = new Routes ( client )
245
- return t . throws ( ( ) => { routes . delete ( ) } , / M i s s i n g m a n d a t o r y p a r a m e t e r s : b a s e p a t h o r n a m e / )
245
+ return t . throws ( ( ) => { routes . delete ( ) } , { message : / M i s s i n g m a n d a t o r y p a r a m e t e r s : b a s e p a t h o r n a m e / } )
246
246
} )
247
247
248
248
test ( 'delete routes providing basepath and name' , t => {
@@ -253,7 +253,7 @@ test('delete routes providing basepath and name', t => {
253
253
basepath : 'bp' ,
254
254
name : 'nm'
255
255
} )
256
- } , / I n v a l i d p a r a m e t e r s : u s e b a s e p a t h o r n a m e , n o t b o t h / )
256
+ } , { message : / I n v a l i d p a r a m e t e r s : u s e b a s e p a t h o r n a m e , n o t b o t h / } )
257
257
} )
258
258
259
259
test ( 'should create a route' , t => {
@@ -763,8 +763,8 @@ test('should parse path parameters', t => {
763
763
764
764
test ( 'create routes missing mandatory parameters' , t => {
765
765
const routes = new Routes ( )
766
- t . throws ( ( ) => { routes . create ( ) } , / M i s s i n g m a n d a t o r y p a r a m e t e r s : r e l p a t h , o p e r a t i o n , a c t i o n / )
767
- t . throws ( ( ) => { routes . create ( { relpath : true , operation : true } ) } , / M i s s i n g m a n d a t o r y p a r a m e t e r s : a c t i o n / )
768
- t . throws ( ( ) => { routes . create ( { action : true , operation : true } ) } , / M i s s i n g m a n d a t o r y p a r a m e t e r s : r e l p a t h / )
769
- t . throws ( ( ) => { routes . create ( { relpath : true , action : true } ) } , / M i s s i n g m a n d a t o r y p a r a m e t e r s : o p e r a t i o n / )
766
+ t . throws ( ( ) => { routes . create ( ) } , { message : / M i s s i n g m a n d a t o r y p a r a m e t e r s : r e l p a t h , o p e r a t i o n , a c t i o n / } )
767
+ t . throws ( ( ) => { routes . create ( { relpath : true , operation : true } ) } , { message : / M i s s i n g m a n d a t o r y p a r a m e t e r s : a c t i o n / } )
768
+ t . throws ( ( ) => { routes . create ( { action : true , operation : true } ) } , { message : / M i s s i n g m a n d a t o r y p a r a m e t e r s : r e l p a t h / } )
769
+ t . throws ( ( ) => { routes . create ( { relpath : true , action : true } ) } , { message : / M i s s i n g m a n d a t o r y p a r a m e t e r s : o p e r a t i o n / } )
770
770
} )
0 commit comments