A utility to build a UMD (Universal Module Definition) for Enzyme. This can be used for any testing project dependent on Enzyme that uses AMD, Global/Window, or ES6 module loading, instead of Node's Common JS module loading.
Run:
npm run build
This will generate a minified and non-minified enzyme-react.js
UMD module file in the build
directory.
As long as enzyme-react.js
is in the require JS path, you can require it just as with other dependencies:
define(['enzyme-react'], function (enzymeReact) {
const { react, enzyme } = enzymeReact;
});
window['enzyme-react'].react
window['enzyme-react'].enzyme
Run:
npm test
Run:
npm run all
- Avoid loading multiple versions of React. Use the version packaged with this module.
- Ensure proper version of Enzyme/React. This project is currently set up to build Enzyme 3.X and React 16.X.