Skip to content

Commit cddad0d

Browse files
test: add array test for intrinsic func
1 parent 6c0128e commit cddad0d

File tree

1 file changed

+26
-0
lines changed

1 file changed

+26
-0
lines changed

lib/deploy/stepFunctions/compileStateMachines.test.js

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -645,7 +645,25 @@ describe('#compileStateMachines', () => {
645645
},
646646
MessageBody: 'This is a static message',
647647
},
648+
Next: 'Parallel',
649+
},
650+
Parallel: {
651+
Type: 'Parallel',
648652
End: true,
653+
Branches: [
654+
{
655+
StartAt: 'Lambda2',
656+
States: {
657+
Lambda2: {
658+
Type: 'Task',
659+
Resource: {
660+
Ref: 'MyFunction2',
661+
},
662+
End: true,
663+
},
664+
},
665+
},
666+
],
649667
},
650668
},
651669
},
@@ -684,5 +702,13 @@ describe('#compileStateMachines', () => {
684702
expect(sqs.Parameters.QueueUrl.startsWith('${')).to.eq(true);
685703
const queueUrlParam = sqs.Parameters.QueueUrl.replace(/[${}]/g, '');
686704
expect(params[queueUrlParam]).to.eql({ Ref: 'MyQueue' });
705+
706+
const parallel = modifiedDefinition.States.Parallel;
707+
expect(parallel.Branches).to.have.lengthOf(1);
708+
const lambda2 = parallel.Branches[0].States.Lambda2;
709+
expect(lambda2.Resource.startsWith('${')).to.eq(true);
710+
const functionParam2 = lambda2.Resource.replace(/[${}]/g, '');
711+
expect(params).to.haveOwnProperty(functionParam2);
712+
expect(params[functionParam2]).to.eql({ Ref: 'MyFunction2' });
687713
});
688714
});

0 commit comments

Comments
 (0)