David Garcia
01/26/2022, 9:19 PMRoss Coundon
01/26/2022, 9:20 PMDavid Garcia
01/26/2022, 9:34 PMimport * as aws from 'aws-sdk';
const s3 = aws.S3();
// ... do things with that such as
s3.upload( ... );
David Garcia
01/26/2022, 9:36 PMthdxr
01/26/2022, 10:04 PMthdxr
01/26/2022, 10:04 PMDerek Kershner
01/26/2022, 10:12 PMIt seems like it expects that you use clients...If you are still using the v2 sdk, there is another mocking library you can use, but its also pretty easy to just use
jest.mock
in that case, since they are all together.Derek Kershner
01/26/2022, 10:13 PMWe generally recommend not to mock aws services and run tests against a real deployment@thdxr, I think mocking for unit tests is the only reasonable solution, but I think integration tests can be useful as well as a backup. "Testing pyramid", yeah?
Ross Coundon
01/26/2022, 10:18 PMTomasz Sobczyk
01/27/2022, 12:02 AM