-
Notifications
You must be signed in to change notification settings - Fork 3
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
feat: add ability to specify an array in expectedResponseContentType #48
Conversation
lib/components/rest.ts
Outdated
}); | ||
ctx.end(); | ||
if (actualResponseContentType && expectedResponseContentType) { | ||
let invalidResponseContentType; |
There was a problem hiding this comment.
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
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Have renamed it
}); | ||
ctx.end(); | ||
if (actualResponseContentType && expectedResponseContentType) { | ||
let isInvalidResponseContentType; |
There was a problem hiding this comment.
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
Add the ability to specify an array in
expectedResponseContentType
option