You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Nov 30, 2020. It is now read-only.
I would like to discuss the possibility of an unreachable statement in the http module:
class HttpApi {
constructor(options) {
if (options) {
...
}
// What I'm interested in discussing:
if (!this.host)
throw Error("Host option is required.");
}
This is line 38 of the file. When can this be reached if there no possibility of creating an empty HttpApi object? Even when we do new HttpApi({host: ""}) it will return the previous error defined with invalid host url.
If you can help me understand when this if statement is reached, I can potentially add one more test to it to make sure this line is covered.
Thanks in advance for your help.
The text was updated successfully, but these errors were encountered:
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
I would like to discuss the possibility of an unreachable statement in the
http
module:This is line 38 of the file. When can this be reached if there no possibility of creating an empty HttpApi object? Even when we do
new HttpApi({host: ""})
it will return the previous error defined with invalid host url.If you can help me understand when this if statement is reached, I can potentially add one more test to it to make sure this line is covered.
Thanks in advance for your help.
The text was updated successfully, but these errors were encountered: