Dom-testing-library: Provide chai assertions

Created on 7 Apr 2018  路  11Comments  路  Source: testing-library/dom-testing-library

Would be nice to have chai assertions within this library

documentation help wanted

All 11 comments

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

Would you be willing to add that?

I would like to add this in readme

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

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

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 :)

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.

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 :-/

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?

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

:tada: This issue has been resolved in version 1.5.0 :tada:

The release is available on:

Your semantic-release bot :package::rocket:

Was this page helpful?
0 / 5 - 0 ratings

Related issues

eliyaomid picture eliyaomid  路  3Comments

ysgk picture ysgk  路  3Comments

PaulInglis picture PaulInglis  路  3Comments

icfantv picture icfantv  路  4Comments

szabototo89 picture szabototo89  路  4Comments