Skip to content

Commit dae01f4

Browse files
committed
test: remove NodeHttpHandler dependency
1 parent 6c3a1f3 commit dae01f4

File tree

1 file changed

+7
-10
lines changed

1 file changed

+7
-10
lines changed

packages/middleware-flexible-checksums/src/middleware-flexible-checksums.retry.integ.spec.ts

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,20 @@
11
import { S3 } from "@aws-sdk/client-s3";
2-
import { NodeHttpHandler } from "@smithy/node-http-handler";
32
import { HttpResponse } from "@smithy/protocol-http";
43
import { describe, expect, test as it } from "vitest";
54

65
describe("middleware-flexible-checksums.retry", () => {
76
it("retry reuses the checksum", async () => {
87
const maxAttempts = 3;
9-
class CustomHandler extends NodeHttpHandler {
10-
async handle() {
11-
return {
8+
const client = new S3({
9+
maxAttempts,
10+
requestHandler: {
11+
handle: async () => ({
1212
response: new HttpResponse({
1313
statusCode: 500, // Fake Trasient Error
14-
headers: {},
1514
}),
16-
};
17-
}
18-
}
19-
const requestHandler = new CustomHandler();
20-
const client = new S3({ maxAttempts, requestHandler });
15+
}),
16+
},
17+
});
2118

2219
let flexChecksCalls = 0;
2320
client.middlewareStack.addRelativeTo(

0 commit comments

Comments
 (0)