mjackson / expect

Write better assertions
MIT License
2.29k stars 117 forks source link

What can I do if I want to use this lib with mocha? #249

Closed ghost closed 5 years ago

ghost commented 5 years ago

I like the semi-BDD approach of mocha and using test() instead of describe(it()) would be a huge step backward for me. Will this repo merged into jest? If not, where can we find the new documentation and where can we send the new issues? What alternatives do you have if we don't want to use jest? There is an old https://github.com/Automattic/expect.js I used that previously, but it is no longer maintained, that's why I tried this one. Probably I should have read the readme file more carefully...

ljharb commented 5 years ago

No, this repo is for v1 of expect and will linger forever.

You use this in mocha by importing it - just like other non-jest assertion libraries.

ghost commented 5 years ago

@ljharb I think you are missing the point. The documentation here is not maintained e.g. "toBeA" is no longer working and spies do not work either in v23.5.0, and by the issues you tell that we should send them to jest. This is not the proper way to end a project or to give it to a different organization...

ljharb commented 5 years ago

@inf3rno please see the note at the top of the readme: https://github.com/mjackson/expect#notice

This repo is only relevant if you’re using a version < 21; if you have issues with v21+, you’ll either need to downgrade to v1, or file issues on jest’s repo.

ghost commented 5 years ago

Maybe I ask too much. In my dictionary this would be a WARNING with very big letters, not a notice, e.g.:

WARNING this repo was merged into jest from versions v21+!!!

If you want to upgrade:

For old versions:


Documentation for old versions v20-

...

ljharb commented 5 years ago

Considering that this repo isn't linked from https://npmjs.com/expect - jest is - I don't think that's necessary. If you want to read the docs for a package you're using, start on the package's page, and click through from there - and you'll end up at the right place.

ghost commented 5 years ago

I found this repo using google. Not everybody uses the npm page...

ljharb commented 5 years ago

Since you installed the software from npm, it doesn't really make sense to use anything else (and expect you'll always get the right result).

ghost commented 5 years ago

Well I really don't have the time for this, so this will be my last comment. What I use to do is write into google or into the github search field my keywords, check the quick starts from the readme files, the stars, the last updates and the travis results of the repos. If I think someting is worth to use, then I follow the installation guide in the readme file, which is usually npm install xy --save. I use the npmjs site only if I want to publish something and I want to check whether a name already exists. Actually there is a CLI command for that too, but I always forget it, so it is faster to check the site, than reading the documentation again. I am going to use chai instead, their API is not as good as yours, but at least they don't have communication problems. Good luck!