How to use the spyOnEachPage function from aws-sdk
Find comprehensive JavaScript aws-sdk.spyOnEachPage code examples handpicked from public code repositorys.
124 125 126 127 128 129 130 131 132
describe('listing things', () => { afterEach(() => AWS.clearAllMocks()); it('can mock .eachPage directly', async () => { const list = AWS.spyOnEachPage('S3', 'listObjectsV2', [ { Contents: [1, 2, 3] }, { Contents: [4, 5, 6] } ]);
3
19
79
+ 7 other calls in file
GitHub: mapbox/aws-sdk-jest
121 122 123 124 125 126 127 128 129
await expect(() => eachPager()).rejects.toThrow('foo'); }); it('demands you provide pages to mock .eachPage()', async () => { expect(() => AWS.spyOnEachPage('S3', 'listObjectsV2')).toThrow( 'to mock .eachPage(), you must provide an array of pages' ); });
3
19
79
+ 23 other calls in file
45 46 47 48 49 50 51 52 53 54
Objects: [{ Key: 'test/path/1.txt' }, { Key: 'text/path/2.txt' }], }, }) }) test('should show message when files not found', async () => { const listFiles = AWS.spyOnEachPage('S3', 'listObjectsV2', []) const deleteFiles = new Delete({ ...baseParameters, digitalEnableSemver: false,
2
10
3
+ 23 other calls in file
aws-sdk.S3 is the most popular function in aws-sdk (7245 examples)