-
-
Notifications
You must be signed in to change notification settings - Fork 305
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
Question: Why does t.doesNotThrow have three arguments? #334
Comments
It's an It's meant to mirror the |
I do not see how we can check type of error which has not been thrown. Sorry, I might be missing something. It seems the in the API for assert doesNotThrow only takes two arguments https://www.npmjs.com/package/assert#assertdoesnotthrowblock-message. But might be looking in the wrong place. |
@des-des that package is not the core module |
To prevent issues like tape-testing#334, here is a proposal to clarify the purpose of the second argument. My own first reaction to the second argument was like "Whaaat, the docs cannot be right. Even the mere word 'expected' is against the purpose of the assertion. How we can expect something that is not thrown. The argument cannot have any meaning." Then I browsed through the issues, found tape-testing#334 and then it became clear.
I do not understand why
t.doesNotThrow(fn, expected, msg)
has three arguments. It seems like the second argument,expected
, is actually used as the message: https://github.com/substack/tape/blob/master/lib/test.js#L476.Why doesn't the function just have the signature
t.doesNotThrow(fn, message)
?The text was updated successfully, but these errors were encountered: