Skip to content

Commit

Permalink
Update client.spec.ts
Browse files Browse the repository at this point in the history
  • Loading branch information
kuhe committed Sep 9, 2024
1 parent 78c26dd commit 082b7f9
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
6 changes: 6 additions & 0 deletions packages/smithy-client/src/client.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -67,5 +67,11 @@ describe("SmithyClient", () => {
await expect(client.send(getCommandWithOutput("foo") as any, {})).resolves.toEqual("foo");
expect(privateAccess()).toBeUndefined();
});

it("unsets the cache if client.destroy() is called.", async () => {
await expect(client.send(getCommandWithOutput("foo") as any)).resolves.toEqual("foo");
client.destroy();
expect(privateAccess()).toBeUndefined();
});
});
});
2 changes: 1 addition & 1 deletion packages/smithy-client/src/client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ export class Client<
}

destroy() {
this.config.requestHandler.destroy?.();
this.config?.requestHandler?.destroy?.();
delete this.handlers;
}
}

0 comments on commit 082b7f9

Please sign in to comment.