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
Create chai assertion plugin #12
Comments
I assume |
yes. excellent! We should get a list of the desired extensions and implement... |
Hello! I am currently working on an enzyme-chai framework. I call it Currently the API looks like this:
I am likely going to spin this in to its own repo though, not inside reagent. What do you think? |
How about also having one with a better API like |
@goatslacker when you build a chai plugin, it automatically adds them for all three of its APIs: |
Well that's badass. TIL |
@goatslacker what said @lelandrichardson is correct. Some of what I am doing is name spacing (e.g. |
chai.js core dev here. here at product hunt, we've built an internal project, quite similar to enzyme, and we are now looking to migrate. we already have custom chai.js assertions for our internal project, and porting those for enzyme will be quite straight forward. if you are interested in a collaboration, let me know. edit: some assertions we use to.have.tagName
to.have.html
to.have.style
to.have.text
to.have.value
to.have.css
to.have.attr
to.have.props
to.have.component().with.props() most of the stuff from https://github.com/chaijs/chai-jquery is applicable too |
We are currently working on moving this from internal testing to external |
@vesln that sounds awesome! As you migrate the chai matchers, could you ensure that none of them end in properties, ie, they all require a terminal function invocation? |
All, we just open sourced our chai.js assertions for enzyme. Feedback/prs/feature requests/issues are very welcome! @ljharb lmk if you are ok with including it in the docs so more people can discover and leverage it. I'll update chai.js's website later this week as well. |
@vesln awesome! The only issues I see are Otherwise, a PR would be welcome to add it to the docs :-) |
@ljharb the issue is that those methods are already getters in chai.js itself and we cannot redefine them. what i can do tho is alias them to |
sure, that sounds awesome - i have no objection to mentioning exist/empty in the chai-enzyme docs either, as long as there's alternatives :-) |
👍 |
Closing as there is now: https://github.com/producthunt/chai-enzyme |
Potential API:
The text was updated successfully, but these errors were encountered: