I'm trying to mock DocumentClient using aws-sdk-client-mock.
import { mockClient } from 'aws-sdk-client-mock';
import { DocumentClient } from 'aws-sdk/clients/dynamodb';
const mockDocClient = mockClient(DocumentClient);
I'm getting the error TypeError: Cannot read properties of undefined (reading 'isSinonProxy').
Does anyone know where should I set this value?
You just need to check that
DocumentClientwas not mocked before callingmockClientfunction.At least for me this error happens when I trying to mock already mocked
CognitoIdentityProviderClientclass.In my case part with
jest.mockfor CognitoIdentityProviderClient causes the problem.