Should JSX Extensions
should-jsx
provides JSX-comparison assertions for
should.js. This allows simple and less
fragile assertions of the output of a JSX render e.g. when using the React
TestUtils shallow renderer. Lifted almost in its entirety from
expect-jsx, so credit to that module's
author.
Installation
Install via npm. Note that should-jsx
has should
as a peer dependency, so
you'll need to install both to use this, e.g.
npm install should should-jsx --save-dev
Usage
Just import should-jsx
after your import should, and it will add the JSX
assertions to the should instance. Then when
;;; ; // Example with Mocha, but this applies anywhere should.js is used;