test(client-sqs): check for content-type in input and output#7656
Open
test(client-sqs): check for content-type in input and output#7656
Conversation
kuhe
reviewed
Jan 14, 2026
|
|
||
| it(`can make requests with ${client.config.protocol.constructor.name}`, async () => { | ||
| const queues = await client.listQueues(); | ||
| expect(queues.QueueUrls ?? []).toBeInstanceOf(Array); |
Contributor
There was a problem hiding this comment.
the test should retain this brief assertion of the output JS structure, shallow though it may be
Member
Author
There was a problem hiding this comment.
This will always be true, since it's always an instance of Array (even if QueueUrls is undefined)
Welcome to Node.js v20.19.0.
Type ".help" for more information.
> (undefined ?? []) instanceof Array
trueIf there are no queues in the account, QueueUrls is undefined
{
'$metadata': {
httpStatusCode: 200,
requestId: '7652a27f-b8b7-56a0-9887-c39ebdf93168',
extendedRequestId: undefined,
cfId: undefined,
attempts: 1,
totalRetryDelay: 0
}
}
Member
Author
There was a problem hiding this comment.
We already have expect.assertions to confirm that assertions inside middleware are called.
I still added check for httpStatusCode in 598e2ed
kuhe
reviewed
Jan 14, 2026
| }, | ||
| { step: "build" } | ||
| ); | ||
| await client.listQueues({ MaxResults: 1 }); |
Contributor
There was a problem hiding this comment.
Suggested change
| await client.listQueues({ MaxResults: 1 }); | |
| const queues = await client.listQueues({ MaxResults: 1 }); | |
| expect(queues.QueueUrls ?? []).toBeInstanceOf(Array); |
kuhe
approved these changes
Jan 14, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Issue
Noticed while examining e2e test output in JS-6477
Description
Checks for content-type in input and output when different protocol is passed.
Also saves time while executing test by listing just one queue.
Testing
Before
Prints lot of debug statements, and doesn't check for content-type used by protocol.
After
Doesn't print debug statements, and checks for content-type used by protocol.
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.