Skip to content

Commit 1e97eeb

Browse files
committed
test: update s3 storage test
- Update test case to assert that an error is thrown instead of matching a snapshot. - Remove obsolete snapshot.
1 parent 6929060 commit 1e97eeb

File tree

2 files changed

+2
-10
lines changed

2 files changed

+2
-10
lines changed

test/__snapshots__/s3-storage.spec.ts.snap

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Jest Snapshot v1, https://goo.gl/fbAQLP
1+
// Jest Snapshot v1, https://jestjs.io/docs/snapshot-testing
22

33
exports[`S3Storage .create() should handle existing 1`] = `
44
{
@@ -47,14 +47,6 @@ S3File {
4747
}
4848
`;
4949

50-
exports[`S3Storage .create() should send error on invalid s3 response 1`] = `
51-
{
52-
"detail": "s3 create multipart upload error",
53-
"message": "FileError",
54-
"name": "UploadxError",
55-
"uploadxErrorCode": "FileError",
56-
}
57-
`;
5850

5951
exports[`S3Storage .write() should request api and set status and bytesWritten 1`] = `
6052
{

test/s3-storage.spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ describe('S3Storage', () => {
8484
it('should send error on invalid s3 response', async () => {
8585
s3Mock.on(HeadObjectCommand).rejects();
8686
s3Mock.on(CreateMultipartUploadCommand).resolves({});
87-
await expect(storage.create(req, metafile)).rejects.toMatchSnapshot();
87+
await expect(storage.create(req, metafile)).rejects.toThrow();
8888
});
8989
});
9090

0 commit comments

Comments
 (0)