Skip to content
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

The assert.fail([message]) format should be supported for compatibility with NodeJS assert interface #1116

Closed
s-leroux opened this issue Jan 5, 2018 · 0 comments

Comments

@s-leroux
Copy link
Contributor

s-leroux commented Jan 5, 2018

The NodeJS assert interface supports being called with 1 (or 0) arguments:
https://nodejs.org/api/assert.html#assert_assert_fail_message

But currently Chai's assert.fail only supports being called with 2 (or more arguments) leading to that idiom to fail with a custom error message:

assert.fail(0,1, "Custom error message");

The interface should be modified so we can write that instead:

assert.fail("Custom error message");
s-leroux added a commit to s-leroux/chai that referenced this issue Jan 5, 2018
s-leroux added a commit to s-leroux/chai that referenced this issue Jan 5, 2018
In relation to chaijs#1116, the `assert.fail` interface should accept
ibeing called with only 1 arguments to fail with a custom message.
s-leroux added a commit to s-leroux/chai that referenced this issue Jan 11, 2018
Fix chaijs#1116.
The `assert.fail` interface should accept being called with
only 1 arguments to fail with a custom message.
s-leroux added a commit to s-leroux/chai that referenced this issue Jan 11, 2018
Fix chaijs#1116.
The `assert.fail` interface should accept being called with
only 1 arguments to fail with a custom message.
s-leroux added a commit to s-leroux/chai that referenced this issue Jan 11, 2018
Fix chaijs#1116.
The `assert.fail` interface should accept being called with
only 1 arguments to fail with a custom message.
@meeber meeber closed this as completed in 0d1b586 Jan 12, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant