File tree Expand file tree Collapse file tree 1 file changed +25
-0
lines changed
lib/deploy/events/apiGateway Expand file tree Collapse file tree 1 file changed +25
-0
lines changed Original file line number Diff line number Diff line change @@ -413,4 +413,29 @@ describe('#httpValidate()', () => {
413413 expect ( validated . events ) . to . be . an ( 'Array' ) . with . length ( 1 ) ;
414414 expect ( validated . events [ 0 ] . http . cors . methods ) . to . deep . equal ( [ 'POST' , 'OPTIONS' ] ) ;
415415 } ) ;
416+
417+ it ( 'should set cors Access-Control-Max-Age headers' , ( ) => {
418+ serverlessStepFunctions . serverless . service . stepFunctions = {
419+ stateMachines : {
420+ first : {
421+ events : [
422+ {
423+ http : {
424+ method : 'POST' ,
425+ path : '/foo/bar' ,
426+ cors : {
427+ origin : '*' ,
428+ maxAge : 86400 ,
429+ } ,
430+ } ,
431+ } ,
432+ ] ,
433+ } ,
434+ } ,
435+ } ;
436+
437+ const validated = serverlessStepFunctions . httpValidate ( ) ;
438+ expect ( validated . events [ 0 ] . http . cors . origin ) . to . equal ( '*' ) ;
439+ expect ( validated . events [ 0 ] . http . cors . maxAge ) . to . equal ( 86400 ) ;
440+ } ) ;
416441} ) ;
You can’t perform that action at this time.
0 commit comments