Test assertion helpers for use with React's shallowRender test utils.
npm install skin-deep
Breaking Change: Prior to version 0.14, text() normalisation incorrectly added spaces between children. This was technically a bug, but upgrading will break any tests which relied on the old behaviour.
TODO
For now, see the tests.
Some people have been helpful enough to write some blog posts about skin deep, which you may find useful.
You can also consult the documentation for the upcoming Version 1.0, which is mostly accurate for the current version.
This lib currently supports both React 0.13 and React 0.14. If you are using a bundling tool for your test suite this will cause problems. You will need to add config to ignore the React internals for the version you are not using:
// React 0.14 & Webpack
plugins: [
new webpack.IgnorePlugin(/ReactContext/),
]
// React 0.13 & Webpack
plugins: [
new webpack.IgnorePlugin(/react-addons|react-dom/),
]
// React 0.14 & Browserify
bundle.exclude('react/lib/ReactContext');
// React 0.13 & Browserify
bundle.exclude('react-dom/server');
bundle.exclude('react-addons-test-utils');
TODO
For now, see the tests.
You can also consult the documentation for the upcoming Version 1.0, which is mostly accurate for the current version.