You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
importAWSMockfrom"aws-sdk-mock"importAWSfrom"aws-sdk"import{ExecuteStatementCommand}from"@aws-sdk/client-rds-data"import{handler}from'../src'// context redacteddescribe("test lambda function handler",()=>{beforeEach(()=>{AWSMock.setSDKInstance(AWS)})afterEach(()=>{AWSMock.restore()})it("should run",async()=>{AWSMock.setSDKInstance(AWS)// error in following line that RDSDataClient is not knownAWSMock.mock("RDSDataClient","send",(params: ExecuteStatementCommand,callback: Function)=>{// <========================console.log("DynamoDB","getItem","mock called")callback(null,{formattedRecords: JSON.stringify([])})})constres=awaithandler(/*...*/)// make asserts})})
The text was updated successfully, but these errors were encountered:
@nelsonic thank you for getting back to the issue so quickly. I updated the issue text to keep the thread short. Let me know, if you need anything else.
RDSDataClient
is not part of the the mock library but should be.Lambda function example code:
Test:
The text was updated successfully, but these errors were encountered: