React base app with Webpack and Mocha/Chai testing
NOTE: installation requires io.js version of Node due to jsdom requirements (if you want to use tests)
- clone the repository and change there
- npm install
- npm start
- go to http://localhost:8080/
- npm build > full app as a optimized bundle
- npm run library > only one components as CommonJS library (or other Webpack supported build)
There's sample index.html in the doc/ folder for ES5 based use case with global vars and no modules.
For full app use the bundle.js that build command produces.
For use as a library, run the library build and use any JS module system (ES6, node, systemjs).
This version only produces a library from one component (kuppi.csjx). You can change this using entry setting in the Webpack config under library target.
node_modules/mocha/bin/mocha test/*.jsx --require babel/register
Or just mocha depending on your $PATH settings.
Install Istanbul using Babel support wrapper to global NPM:
npm install -g babel-core babel-istanbul
babel-istanbul cover _mocha -- test/*.jsx --require babel/register
Report will go to coverage folder.
babel-istanbul report -v html