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 should.fail() are not documented #487

Closed
astorije opened this issue Jul 17, 2015 · 10 comments
Closed

expect.fail() and should.fail() are not documented #487

astorije opened this issue Jul 17, 2015 · 10 comments

Comments

@astorije
Copy link
Member

expect.fail() and should.fail() have been added in version 2.1.0. Although they both have a docstring (docstring for expect and docstring for should), they cannot be found in the documentation. Their assert counterpart, however, can be found here.

That would be very useful for plugin developers :-)

@keithamus
Copy link
Member

Thanks @astorije. The docs are available in the code, they just haven't been run through the website yet 😢

Just like #488 I'll close this. Please head on over to chaijs/chaijs.github.io#74 and chaijs/chaijs.github.io#34 to help out if you can.

@bookercodes
Copy link

This still isn't documented as far as I can tell 😢

@lucasfcosta
Copy link
Member

I think it may be because the docs for expect/should are generated based on the assertions.js file instead of the interface files.
Maybe adding .fail to the same namespace as the other assertions would be enough, but I'm not sure about it, I'd need to take a further look at dox docs (lol) to make sure.

EDIT:
Taking a look at these might be helpful:
https://github.com/chaijs/chai-docs/blob/gh-pages/_data/chai.json#L687
https://github.com/chaijs/chai-docs/blob/gh-pages/_layouts/api.html

@keithamus
Copy link
Member

Looks like this is a small bug with the docs I suppose.

The way the docs work right now, is that the BDD (expect/should) pages set yaml front matter of api_namespace to BDD (https://github.com/chaijs/chai-docs/blob/gh-pages/api/bdd.md). As @lucasfcosta points out - the api page then iterates through all of the data generated from dox
(found here https://github.com/chaijs/chai-docs/blob/gh-pages/_data/chai.json) and if the namespace matches (in this case, BDD) then that doc gets rendered. So for example .a(type) (docs in code are here: https://github.com/chaijs/chai/blob/master/lib/chai/core/assertions.js#L131-L160) gets rendered here: http://chaijs.com/api/bdd/#atype.

The problem is that should.fail has a @namespace of Should (https://github.com/chaijs/chai/blob/master/lib/chai/interface/should.js#L44-L56), and expect.fail has Expect as the @namespace.

The easiest way to fix: just change the @namespace in the .fail methods to BDD.

@lucasfcosta
Copy link
Member

Seems good, I'm gonna do it this afternoon then, this seems to be very important for our users.

@bookercodes
Copy link

Hi 👋

I went looking for expect.fail() again today but I still can't find it in the documentation.

Am I blind?

@keithamus
Copy link
Member

Hey @alexbooker we have yet to release the update docs. It'll happen in the next few weeks, rest assured.

@bookercodes
Copy link

@keithamus Thanks for the update.

Please keep up the top-notch work 😄

@gasi
Copy link

gasi commented Sep 29, 2016

FYI, I just checked but couldn’t find it either. Glad it exists 😄

@erikerikson
Copy link

First two arguments are still not documented as optional:
http://chaijs.com/api/bdd/#method_fail

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

6 participants