Skip to content

Commit f611231

Browse files
committed
test: use itParam to test both JSONPath and JSONata scenarios
1 parent b1adb00 commit f611231

File tree

1 file changed

+12
-5
lines changed

1 file changed

+12
-5
lines changed

lib/deploy/stepFunctions/compileIamRole.test.js

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3587,7 +3587,7 @@ describe('#compileIamRole', () => {
35873587
]);
35883588
});
35893589

3590-
it('should resolve FunctionName from the Arguments property when there is no Parameters property', () => {
3590+
itParam('should resolve FunctionName: ${value}', ['JSONPath', 'JSONata'], (queryLanguage) => {
35913591
serverless.service.stepFunctions = {
35923592
stateMachines: {
35933593
myStateMachine1: {
@@ -3598,10 +3598,17 @@ describe('#compileIamRole', () => {
35983598
A: {
35993599
Type: 'Task',
36003600
Resource: 'arn:aws:states:::lambda:invoke',
3601-
Arguments: {
3602-
FunctionName: 'arn:aws:lambda:us-west-2:1234567890:function:foo',
3603-
Payload: '{% $states.input.Payload %}',
3604-
},
3601+
...getParamsOrArgs(
3602+
queryLanguage,
3603+
{
3604+
FunctionName: 'arn:aws:lambda:us-west-2:1234567890:function:foo',
3605+
'Payload.$': '$.Payload',
3606+
},
3607+
{
3608+
FunctionName: 'arn:aws:lambda:us-west-2:1234567890:function:foo',
3609+
Payload: '{% $states.input.Payload %}',
3610+
},
3611+
),
36053612
End: true,
36063613
},
36073614
},

0 commit comments

Comments
 (0)