We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
I have a function calling stepfunctions.startExecution(params) which i need to mock and the mock i am trying isn't working.
My function:
export const function= async (inputs): Promise<StepFunctions.StartExecutionOutput> => { const stepfunctions = new StepFunctions(); . . . const params = { stateMachineArn, input: inputs, name: executionName, }; return stepfunctions.startExecution(params).promise(); };
and my test looks like:
it('should trigger step functions to start', async () => { const response = 'Step function started'; AWSMock.setSDKInstance(AWS); AWSMock.mock(stepFunctions, 'startExecution', response); const result = await issueReport(qualificationId, sessionId, date); expect(result).toEqual(response); AWSMock.restore(stepFunctions); });
Am i doing something wrong?
Packages: "aws-sdk": "^2.847.0", "aws-sdk-mock": "^5.1.0", "jest": "26.6.0",
The text was updated successfully, but these errors were encountered:
Hey @lj91421 , I too am facing this issue. Did you end up resolving it?
Sorry, something went wrong.
@lprhodes This does seem to be working for me now. I only changed the mocking of the start execution. it looks like:
AWSMock.mock(stepFunctions, 'startExecution', (params: any, callback: any) => { callback(null, response); });
Thanks @lj9142 For us it was the difference between import * as AWSMock and import AWSMock that caused the problem
import * as AWSMock
import AWSMock
No branches or pull requests
I have a function calling stepfunctions.startExecution(params) which i need to mock and the mock i am trying isn't working.
My function:
and my test looks like:
Am i doing something wrong?
Packages:
"aws-sdk": "^2.847.0",
"aws-sdk-mock": "^5.1.0",
"jest": "26.6.0",
The text was updated successfully, but these errors were encountered: