Skip to content
New issue

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

mocking S3.listObjectV2 #228

Open
Araminic opened this issue Feb 10, 2021 · 0 comments
Open

mocking S3.listObjectV2 #228

Araminic opened this issue Feb 10, 2021 · 0 comments

Comments

@Araminic
Copy link

Hi,

I am using listObjectV2 in my file.ts and I am importing it by import S3 from 'aws-sdk/clients/s3 and when I try to mock it from my test file, with this code, is not working :
AWSMock.mock('S3', 'listObjectsV2', { Contents: [{ Key: 'object1' }, { Key: 'object2' }] });

But If I import AWS from 'aws-sdk' in my file.ts,, then the mock is working.

Am I doing something wrong?
I would like to import only S3 and not the whole AWS .

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant