@@ -630,6 +630,45 @@ describe('#compileStateMachines', () => {
630
630
expect ( ( ) => serverlessStepFunctions . compileStateMachines ( ) ) . to . throw ( Error ) ;
631
631
} ) ;
632
632
633
+ it ( 'should leave empty tag values as empty string' , ( ) => {
634
+ serverless . service . provider . tags = {
635
+ team : undefined ,
636
+ } ;
637
+
638
+ serverless . service . stepFunctions = {
639
+ stateMachines : {
640
+ myStateMachine1 : {
641
+ definition : 'definition1' ,
642
+ name : 'stateMachineBeta1' ,
643
+ tags : {
644
+ score : undefined ,
645
+ } ,
646
+ } ,
647
+ myStateMachine2 : {
648
+ definition : 'definition2' ,
649
+ name : 'stateMachineBeta2' ,
650
+ tags : {
651
+ score : undefined ,
652
+ } ,
653
+ } ,
654
+ } ,
655
+ } ;
656
+
657
+ serverlessStepFunctions . compileStateMachines ( ) ;
658
+ const stateMachineBeta1 = serverlessStepFunctions . serverless . service
659
+ . provider . compiledCloudFormationTemplate . Resources
660
+ . StateMachineBeta1 ;
661
+ const stateMachineBeta2 = serverlessStepFunctions . serverless . service
662
+ . provider . compiledCloudFormationTemplate . Resources
663
+ . StateMachineBeta2 ;
664
+ expect ( stateMachineBeta1 . Properties . Tags ) . to . have . lengthOf ( 2 ) ;
665
+ expect ( stateMachineBeta2 . Properties . Tags ) . to . have . lengthOf ( 2 ) ;
666
+ expect ( stateMachineBeta1 . Properties . Tags )
667
+ . to . deep . eq ( [ { Key : 'team' , Value : '' } , { Key : 'score' , Value : '' } ] ) ;
668
+ expect ( stateMachineBeta2 . Properties . Tags )
669
+ . to . deep . eq ( [ { Key : 'team' , Value : '' } , { Key : 'score' , Value : '' } ] ) ;
670
+ } ) ;
671
+
633
672
it ( 'should respect CloudFormation intrinsic functions' , ( ) => {
634
673
serverless . service . stepFunctions = {
635
674
stateMachines : {
0 commit comments