algolia/expect-jsx

Add toNotEqualJSX

mjackson opened this issue · 2 comments

We should probably have a toNotEqualJSX method as well, since all our other assertions have a toNot* equivalent.

EDIT: If you decide to export a single object with all your assertions, as I suggested here then users would be able to get both toEqualJSX and toNotEqualJSX with just expect.extend(require('expect-jsx')). :)

also, toIncludeJSX might be cool too:

function renderCounter (count) {
  return <div>
    <span>{count}</span>
    <button>Add</button>
    <button>Reset</button>
  </div>;
}
expect(renderCounter(90)).toIncludeJSX(<span>90</span>)
vvo commented

I was about to say this, both of them are really easy to add. I will do all the changes. Thanks for the ideas!