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

Provide chai assertions #7

Closed
pYr0x opened this issue Apr 7, 2018 · 11 comments · Fixed by #15
Closed

Provide chai assertions #7

pYr0x opened this issue Apr 7, 2018 · 11 comments · Fixed by #15
Labels
documentation An update needs to be made to documentation help wanted Extra attention is needed

Comments

@pYr0x
Copy link

pYr0x commented Apr 7, 2018

Would be nice to have chai assertions within this library

@kentcdodds
Copy link
Member

Thanks for the contribution @pYr0x. I think I'd rather just add a link in the README to https://github.com/nathanboktae/chai-dom 👍

@kentcdodds kentcdodds added help wanted Extra attention is needed documentation An update needs to be made to documentation labels Apr 7, 2018
@kentcdodds
Copy link
Member

Would you be willing to add that?

@manishsaraan
Copy link

I would like to add this in readme

@gnapse
Copy link
Member

gnapse commented Apr 8, 2018

I wonder if it makes sense to extract the jest custom matchers into their own package as well 🤔.

@kentcdodds
Copy link
Member

Yes, I've been considering this. I think it would be a good idea 👍

@gnapse
Copy link
Member

gnapse commented Apr 9, 2018

I actually started doing it on my own after commenting this, cause I wanted an excuse to play around with kcd-scripts and the yeoman generator :)

@gnapse
Copy link
Member

gnapse commented Apr 9, 2018

I did end up extracting the matchers here into a library I called jest-dom. It's not yet on npm or anything because I just started it as an excuse to learn to setup a library (kcd-scripts makes it so easy!) but if it looks ok I'd be happy to provide it (@kentcdodds I gave you access in it but we can also move it here if you prefer).

On the same vein, I wonder if this all could be under a parent repository of multiple packages (something I also want to learn to setup, much like react itself is structured). By "this all" I mean dom-testing-library, react-testing-library, and now jest-dom. Maybe {cypress,vue,etc}-testing-library too if their authors agree. And maybe not a parent repository by an org.

@kentcdodds
Copy link
Member

Thanks for doing that! As soon as you've got that published, then please feel free to open a PR to this repo to have it use that instead (probably only need to update ./extend-expect.js to be require('jest-dom/extend-expect') or something, and remove all the other files associated to these extensions).

On the mono-repo idea. I'm sure it'd be great. Here are some of the problems I have with that approach:

  1. I'm unfamiliar with how to make it work with automatic releases like I have right now. I don't have time to do manual releases.
  2. It would significantly increase the noise I get in my notifications for things that I will never respond to (like for vue and friends).

So for now I don't have time to investigate how to overcome these problems I'm afraid :-/

@gnapse
Copy link
Member

gnapse commented Apr 9, 2018

Yes sure, I wasn't even sure my self how would it work. In any case I think the org was a better idea than the mono repo, but probably also not really needed.

Will proceed with publishing the other repo. Do you mind giving a quick intro about that "automatic releases" thing you mentioned? If I used kcd-scripts in jest-dom, is there anything to be aware of about publishing it now and when it is updated in the future?

@kentcdodds
Copy link
Member

In your project (clean, git-wise), run:

npx semantic-release-cli setup

Follow the prompts (use "Travis"). It'll make changes to your project, go ahead and git reset --hard HEAD with those because you don't need them. Make sure that your version is set to 0.0.0-semantically-released, then push. It should kick in and start auto-releasing! Check out the other/MAINTAINING.md and other/manual-releases.md files to learn more about how that all works.

You can also watch this (a bit dated) video that includes the process (without kcd-scripts): http://kcd.im/write-oss

@kentcdodds
Copy link
Member

🎉 This issue has been resolved in version 1.5.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

alexkrolick pushed a commit to alexkrolick/dom-testing-library that referenced this issue Sep 13, 2018
* feat(typings): add ts definitions

* chore(contributors): add myself
alexkrolick pushed a commit to alexkrolick/dom-testing-library that referenced this issue Sep 13, 2018
* feat(typings): add ts definitions

* chore(contributors): add myself
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation An update needs to be made to documentation help wanted Extra attention is needed
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants