Skip to content

test(node-http-handler): add test cases for NodeHttpHandler #1652

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 5 commits into from
Jul 29, 2025

Conversation

yuji-hatakeyama
Copy link
Contributor

@yuji-hatakeyama yuji-hatakeyama commented Jul 26, 2025

Issue None

Description of changes:

This PR adds test cases for the NodeHttpHandler class.

Changes

  • Add test for connectionTimeout configuration
  • Add test for requestTimeout configuration
  • Add tests for NodeHttpHandler.create() static method

@yuji-hatakeyama yuji-hatakeyama requested a review from a team as a code owner July 26, 2025 15:50
@yuji-hatakeyama yuji-hatakeyama changed the title test(node-http-handler): add comprehensive test coverage for NodeHttpHandler test(node-http-handler): add test cases for NodeHttpHandler Jul 26, 2025
@yuji-hatakeyama yuji-hatakeyama force-pushed the add-node-http-handler-test branch from fd08a10 to df469f4 Compare July 26, 2025 16:15
@yuji-hatakeyama
Copy link
Contributor Author

Sorry I fixed format 4d097a7 .

On my MacOS 15.5 (M3), “yarn format” does not seem to be detected correctly.
This may be due to the cache related to turbo.

% git co df469f4403738435410922d2e30b25ddc5e89269
HEAD is now at df469f44 chore: add empty changeset

% yarn format 1>/dev/null && git diff
turbo 2.3.3

% rm -rf .turbo/cache && yarn format 1>/dev/null && git diff
turbo 2.3.3

diff --git a/packages/node-http-handler/src/node-http-handler.spec.ts b/packages/node-http-handler/src/node-http-handler.spec.ts
index 2f924b54..5f219a82 100644
--- a/packages/node-http-handler/src/node-http-handler.spec.ts
+++ b/packages/node-http-handler/src/node-http-handler.spec.ts
@@ -252,9 +252,12 @@ describe(“NodeHttpHandler”, () => {

     it.each([
       [“existing handler instance”, new NodeHttpHandler()],
-      [“custom HttpHandler object”, {
-        handle: vi.fn(),
-      } as any],
+      [
+        “custom HttpHandler object”,
+        {
+          handle: vi.fn(),
+        } as any,
+      ],
     ])(“returns the input handler when passed %s”, (_, handler) => {
       const result = NodeHttpHandler.create(handler);
       expect(result).toBe(handler);

Disabling the cache when formatting in turbo.json resolved the issue, so I will apply this only to my local environment.

@kuhe kuhe merged commit ace4136 into smithy-lang:main Jul 29, 2025
11 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants