Skip to content

Commit feefed1

Browse files
committed
test(smithy-client): verify that warning emits just once
1 parent 3b0ca23 commit feefed1

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

packages/smithy-client/src/emitWarningIfUnsupportedVersion.spec.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,8 @@ describe("emitWarningIfUnsupportedVersion", () => {
3333
)(`%s`, async (unsupportedVersion) => {
3434
process.emitWarning = jest.fn();
3535
emitWarningIfUnsupportedVersion(unsupportedVersion);
36+
37+
// Verify that the warning was emitted.
3638
expect(process.emitWarning).toHaveBeenCalledTimes(1);
3739
expect(process.emitWarning).toHaveBeenCalledWith(
3840
`The AWS SDK for JavaScript (v3) will\n` +
@@ -42,6 +44,10 @@ describe("emitWarningIfUnsupportedVersion", () => {
4244
`More information can be found at: https://a.co/1l6FLnu`,
4345
`NodeDeprecationWarning`
4446
);
47+
48+
// Verify that the warning emits only once.
49+
emitWarningIfUnsupportedVersion(unsupportedVersion);
50+
expect(process.emitWarning).toHaveBeenCalledTimes(1);
4551
});
4652
});
4753

0 commit comments

Comments
 (0)