Skip to content
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

feat: add ability to specify an array in expectedResponseContentType #48

Merged
merged 2 commits into from
Mar 26, 2024

Conversation

SeqviriouM
Copy link
Contributor

Add the ability to specify an array in expectedResponseContentType option

@SeqviriouM SeqviriouM requested a review from bezany March 26, 2024 07:11
@SeqviriouM
Copy link
Contributor Author

@resure @bezany can you take a look?

@SeqviriouM SeqviriouM requested a review from resure March 26, 2024 15:00
});
ctx.end();
if (actualResponseContentType && expectedResponseContentType) {
let invalidResponseContentType;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe rename it to isInvalidResponseContentType?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Have renamed it

@SeqviriouM SeqviriouM merged commit 10580bd into main Mar 26, 2024
5 checks passed
@SeqviriouM SeqviriouM deleted the seqvirioum/expected-response-content-type-as-array branch March 26, 2024 16:07
});
ctx.end();
if (actualResponseContentType && expectedResponseContentType) {
let isInvalidResponseContentType;
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It might have been look a little simpler if you've checked for valid response content type instead of invalid (since not- checks are harder to read than positive ones).

i.e.

isValidResponseContentType = false

isValidResponseContentType = expectedResponseContentType.includes(String(actualResponseContentType));

isValidResponseContentType = expectedResponseContentType === actualResponseContentType

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.

3 participants