Skip to content

Commit e4af797

Browse files
committed
test(lib-storage): update unit tests
1 parent 7545774 commit e4af797

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

lib/lib-storage/src/Upload.spec.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,13 +27,15 @@ vi.mock("@aws-sdk/client-s3", async () => {
2727
send: sendMock,
2828
config: {
2929
endpoint: endpointMock,
30+
requestChecksumCalculation: () => Promise.resolve("WHEN_SUPPORTED"),
3031
},
3132
}),
3233
S3Client: vi.fn().mockReturnValue({
3334
send: sendMock,
3435
config: {
3536
endpoint: endpointMock,
3637
requestHandler: mockRequestHandler,
38+
requestChecksumCalculation: () => Promise.resolve("WHEN_SUPPORTED"),
3739
},
3840
}),
3941
CreateMultipartUploadCommand: vi.fn().mockReturnValue({
@@ -69,6 +71,7 @@ import {
6971
S3Client,
7072
UploadPartCommand,
7173
} from "@aws-sdk/client-s3";
74+
import { RequestChecksumCalculation } from "@aws-sdk/middleware-flexible-checksums";
7275
import { AbortController } from "@smithy/abort-controller";
7376

7477
import { Progress, Upload } from "./index";
@@ -392,6 +395,7 @@ describe(Upload.name, () => {
392395
expect(CreateMultipartUploadCommand).toHaveBeenCalledWith({
393396
...actionParams,
394397
Body: undefined,
398+
ChecksumAlgorithm: "CRC32",
395399
});
396400
// upload parts is called correctly.
397401
expect(UploadPartCommand).toHaveBeenCalledTimes(2);
@@ -457,6 +461,7 @@ describe(Upload.name, () => {
457461
expect(CreateMultipartUploadCommand).toHaveBeenCalledWith({
458462
...actionParams,
459463
Body: undefined,
464+
ChecksumAlgorithm: "CRC32",
460465
});
461466

462467
// upload parts is called correctly.

0 commit comments

Comments
 (0)