-
-
Notifications
You must be signed in to change notification settings - Fork 693
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
What to expect when you're expecting #501
Comments
Good call as usual @astorije. We should check for other primitives in assertions like these. I think for these kind of assertions we should probably throw an error explaining the problem. In this instance maybe |
What do you mean by I would go for something simple and explicit like What do you think? (Depending on when we reach a decision and how much work is needed/how much time I have, I'll see if I can work on a PR or not) |
Agree, yours sounds much better than mine. |
Okay, I'll see if I can find an hour to send you that within the next few of days. I'd personally prefer |
This is also fixed in d7d9420 (just pasting the merge commit) and can be closed now. |
I was making tests trying to be right on #496 (:smile:) and found that if you assert:
You end up with:
The
assert.include(3, 2);
twin assertion reacts similarly, but the key difference is that theassert.include(haystack, needle)
method definition explicitly says that the haystack should be{Array|String}
(so one just needs to read the doc). The type of the argument given toexpect()
is never specified in the doc (or at least I couldn't find it), meaning this shouldMixed
.Making sure the type is controlled for
expect(...).to.include(...)
is similar to issue #491 and PR #496.I am guessing there are other cases like that but I haven't tested them all. I am not sure if there should be a global way to do that in the code or if we should handle that on a case-by-case basis as what we are leaning to on #496.
The text was updated successfully, but these errors were encountered: