This project demonstrates how to:
- use
babel-plugin-discard-module-references
- to drop all
tape
based tests - including whitelisting the
react
module
- to drop all
- use
browser-tap
to run tests- dev: in the browser
- CI: in a headless browser (
electron
)
- write tests on React components using
enzyme
andsinon
Most interesting files are:
package.json
- Shows required depedencies and
npm scripts
- Shows required depedencies and
.babelrc
- usage of
babel-plugin-discard-module-references
- usage of
webpack.config.js
- few weird things in order to make
sinon
work in the browser
- few weird things in order to make
src/my-component.js
- React component unit testings done right, using
enzyme
- React component unit testings done right, using
Serve in dev mode (includes tests and live reload)
npm install
npm dev
open http://localhost:8080
Serve production mode (no tests, optimized but with live reload)
npm install
npm start # equivalent of NODE_ENV=production npm run dev
Build for production
npm install
npm run build
You can now simply serve the public
folder.
Run tests in CI mode (in electron)
npm install
npm test