Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
assert.fail() accept a single argument or two arguments #12293
Second commit: Remove lint rule that flags use of assert.fail() with a single argument.
Third commit: Remove common.fail() in tests since assert.fail() with a single argument works as expected.
Affected core subsystem(s)
referenced this pull request
Apr 9, 2017
I won't argue if someone thinks it's major. But to answer the question from my view: I think it's minor because using the current API with only one or two arguments will provide a message that I would describe as broken.
It's hard for me to imagine a situation where the current behavior is desirable or expected.
Code in the wild got used to it (maybe someone tests the exception text or whatever other silly things people do), I agree you only change the message, but it's not a "Bug Fix" per se.
"not an actual bug fix" ⚖ "change only in message text"
Although I'm an anarchist at heart, and am pro change, I would vote major
Anyway this discussion is kinda mute since
For what it's worth:
Even though this is currently labeled
Not going to fervently make the case that it needs to land in v6.x, just want it to be considered. @nodejs/lts
Node.js 7.9.0 and earlier:
> assert.fail('one arg') AssertionError: 'one arg' undefined undefined ... > assert.fail(1, 2) AssertionError: 1 undefined 2 ...
With this change:
> assert.fail('one arg') AssertionError: one arg ... > assert.fail(1, 2) AssertionError: 1 != 2 ...