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

expect.fail() and assert.fail() could be better documented #150

Open
ashleyci opened this issue Jun 12, 2017 · 2 comments
Open

expect.fail() and assert.fail() could be better documented #150

ashleyci opened this issue Jun 12, 2017 · 2 comments

Comments

@ashleyci
Copy link

The documentation for expect.fail() and assert.fail() doesn't have an example of usage, took me a minute or two to work out that you can't do expect().to.fail() - also the BDD version (http://chaijs.com/api/bdd/#method_fail) is duplicated in the docs. :)

screen shot 2017-06-12 at 10 33 07

@keithamus
Copy link
Member

Thanks for this @ashleyci.

The docs for the .fail method live in the code here for expect and here for should. I think that is where the duplicate entry is coming from, so we could always set one of those docstrings to ignore (by changing /** to /*!). As for adding examples, you're right we should totally do that! How do you feel about making a PR into chai, to that effect @ashleyci?

@Peter-Lavigne
Copy link

What do each of the arguments do? When using Mocha, the message argument comes up (i.e. AssertionError: Test fails) but none of the others do.

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

3 participants