Skip to content
This repository has been archived by the owner on Jun 17, 2019. It is now read-only.
/ skin-deep Public archive
forked from glenjamin/skin-deep

Test assertion helpers for use with React's shallowRender test utils

License

Notifications You must be signed in to change notification settings

yormi/skin-deep

 
 

Repository files navigation

skin-deep

Test assertion helpers for use with React's shallowRender test utils.

npm version Build Status Coverage Status MIT Licensed

React Version

This lib works on both React 0.13 and React 0.14. Because it uses some tools that changed between these versions, it cannot depend on them directly via package.json. When using React 0.14, you'll need to add react-addons-test-utils into your project's dependencies yourself.

Install

npm install skin-deep

Important Changes

0.14

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.

Usage

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.

Troubleshooting

Errors when bundling

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');
// React 0.14 & jspm
jspm install npm:skin-deep -o "{map: {'react/lib/ReactContext': '@empty'}}"

// React 0.13 & jspm
jspm install npm:skin-deep -o "{map: {'react-dom/server': '@empty'
                                      'react-addons-test-utils': '@empty'}}"

Docs

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.

About

Test assertion helpers for use with React's shallowRender test utils

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • JavaScript 99.6%
  • Shell 0.4%