A unit testing tool for loosely comparing react element trees.
Works well with the react test-utils addon's shallowRenderer. See examples/Box.test.js for a real example. It's designed to make testing of simple components very easy and not get in your way. This is not really suitable to larger complex views.
Install
npm install --save-dev jsx-equals
Usage
Pass it two arguments, the source and the pattern. To allow loose matching it is not associative.
You will generally hard code the right hand side, while the left hand side is generated e.g. by shallowRenderer.
;
Some variations:
var jsxEquals = // or use es6 import // passes because b is unspecified; // special shorthand for comparing without importing; // mark elements you don't care about with jsxEquals.ANY;