@@ -288,6 +288,12 @@ describe('Route Tests:', function() {
288
288
expect ( result ) . to . deep . equal ( { headers : { 'content-type' : 'application/json' } , statusCode : 200 , body : '{"method":"get","status":"ok","param":"123","query":"321"}' , isBase64Encoded : false } )
289
289
} ) // end it
290
290
291
+ it ( 'Path with parameter and multiple querystring: /test/123/query/?test=123&test=321' , async function ( ) {
292
+ let _event = Object . assign ( { } , event , { path : '/test/123/query' , queryStringParameters : { test : [ '123' , '321' ] } } )
293
+ let result = await new Promise ( r => api . run ( _event , { } , ( e , res ) => { r ( res ) } ) )
294
+ expect ( result ) . to . deep . equal ( { headers : { 'content-type' : 'application/json' } , statusCode : 200 , body : '{"method":"get","status":"ok","param":"123","query":["123","321"]}' , isBase64Encoded : false } )
295
+ } ) // end it
296
+
291
297
it ( 'Path with multiple parameters and querystring: /test/123/query/456/?test=321' , async function ( ) {
292
298
let _event = Object . assign ( { } , event , { path : '/test/123/query/456' , queryStringParameters : { test : '321' } } )
293
299
let result = await new Promise ( r => api . run ( _event , { } , ( e , res ) => { r ( res ) } ) )
@@ -364,6 +370,12 @@ describe('Route Tests:', function() {
364
370
expect ( result ) . to . deep . equal ( { headers : { 'content-type' : 'application/json' } , statusCode : 200 , body : '' , isBase64Encoded : false } )
365
371
} ) // end it
366
372
373
+ it ( 'Path with parameter and multiple querystring: /test/123/query/?test=123&test=321' , async function ( ) {
374
+ let _event = Object . assign ( { } , event , { path : '/test/123/query' , httpMethod : 'head' , queryStringParameters : { test : [ '123' , '321' ] } } )
375
+ let result = await new Promise ( r => api . run ( _event , { } , ( e , res ) => { r ( res ) } ) )
376
+ expect ( result ) . to . deep . equal ( { headers : { 'content-type' : 'application/json' } , statusCode : 200 , body : '' , isBase64Encoded : false } )
377
+ } ) // end it
378
+
367
379
it ( 'Path with multiple parameters and querystring: /test/123/query/456/?test=321' , async function ( ) {
368
380
let _event = Object . assign ( { } , event , { path : '/test/123/query/456' , httpMethod : 'head' , queryStringParameters : { test : '321' } } )
369
381
let result = await new Promise ( r => api . run ( _event , { } , ( e , res ) => { r ( res ) } ) )
@@ -432,6 +444,12 @@ describe('Route Tests:', function() {
432
444
expect ( result ) . to . deep . equal ( { headers : { 'content-type' : 'application/json' } , statusCode : 200 , body : '{"method":"post","status":"ok","param":"123","query":"321"}' , isBase64Encoded : false } )
433
445
} ) // end it
434
446
447
+ it ( 'Path with parameter and multiple querystring: /test/123/query/?test=123&test=321' , async function ( ) {
448
+ let _event = Object . assign ( { } , event , { path : '/test/123/query' , httpMethod : 'post' , queryStringParameters : { test : [ '123' , '321' ] } } )
449
+ let result = await new Promise ( r => api . run ( _event , { } , ( e , res ) => { r ( res ) } ) )
450
+ expect ( result ) . to . deep . equal ( { headers : { 'content-type' : 'application/json' } , statusCode : 200 , body : '{"method":"post","status":"ok","param":"123","query":["123","321"]}' , isBase64Encoded : false } )
451
+ } ) // end it
452
+
435
453
it ( 'Path with multiple parameters and querystring: /test/123/query/456/?test=321' , async function ( ) {
436
454
let _event = Object . assign ( { } , event , { path : '/test/123/query/456' , httpMethod : 'post' , queryStringParameters : { test : '321' } } )
437
455
let result = await new Promise ( r => api . run ( _event , { } , ( e , res ) => { r ( res ) } ) )
@@ -519,6 +537,12 @@ describe('Route Tests:', function() {
519
537
expect ( result ) . to . deep . equal ( { headers : { 'content-type' : 'application/json' } , statusCode : 200 , body : '{"method":"put","status":"ok","param":"123","query":"321"}' , isBase64Encoded : false } )
520
538
} ) // end it
521
539
540
+ it ( 'Path with parameter and multiple querystring: /test/123/query/?test=123&test=321' , async function ( ) {
541
+ let _event = Object . assign ( { } , event , { path : '/test/123/query' , httpMethod : 'put' , queryStringParameters : { test : [ '123' , '321' ] } } )
542
+ let result = await new Promise ( r => api . run ( _event , { } , ( e , res ) => { r ( res ) } ) )
543
+ expect ( result ) . to . deep . equal ( { headers : { 'content-type' : 'application/json' } , statusCode : 200 , body : '{"method":"put","status":"ok","param":"123","query":["123","321"]}' , isBase64Encoded : false } )
544
+ } ) // end it
545
+
522
546
it ( 'Path with multiple parameters and querystring: /test/123/query/456/?test=321' , async function ( ) {
523
547
let _event = Object . assign ( { } , event , { path : '/test/123/query/456' , httpMethod : 'put' , queryStringParameters : { test : '321' } } )
524
548
let result = await new Promise ( r => api . run ( _event , { } , ( e , res ) => { r ( res ) } ) )
@@ -660,6 +684,12 @@ describe('Route Tests:', function() {
660
684
expect ( result ) . to . deep . equal ( { headers : { 'content-type' : 'application/json' } , statusCode : 200 , body : '{"method":"options","status":"ok","param":"123","query":"321"}' , isBase64Encoded : false } )
661
685
} ) // end it
662
686
687
+ it ( 'Path with parameter and multiple querystring: /test/123/query/?test=123&test=321' , async function ( ) {
688
+ let _event = Object . assign ( { } , event , { path : '/test/123/query' , httpMethod : 'options' , queryStringParameters : { test : [ '123' , '321' ] } } )
689
+ let result = await new Promise ( r => api . run ( _event , { } , ( e , res ) => { r ( res ) } ) )
690
+ expect ( result ) . to . deep . equal ( { headers : { 'content-type' : 'application/json' } , statusCode : 200 , body : '{"method":"options","status":"ok","param":"123","query":["123","321"]}' , isBase64Encoded : false } )
691
+ } ) // end it
692
+
663
693
it ( 'Path with multiple parameters and querystring: /test/123/query/456/?test=321' , async function ( ) {
664
694
let _event = Object . assign ( { } , event , { path : '/test/123/query/456' , httpMethod : 'options' , queryStringParameters : { test : '321' } } )
665
695
let result = await new Promise ( r => api . run ( _event , { } , ( e , res ) => { r ( res ) } ) )
0 commit comments