Skip to content

jussiarpalahti/react_starter

Repository files navigation

react_starter

React base app with Webpack and Mocha/Chai testing

Installation

NOTE: installation requires io.js version of Node due to jsdom requirements (if you want to use tests)

For production

  • npm build > full app as a optimized bundle
  • npm run library > only one components as CommonJS library (or other Webpack supported build)

Documentation

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.

Run tests

node_modules/mocha/bin/mocha  test/*.jsx --require babel/register

Or just mocha depending on your $PATH settings.

Code Coverage

Install Istanbul using Babel support wrapper to global NPM:

npm install -g babel-core babel-istanbul

Run test coverage

babel-istanbul cover _mocha --  test/*.jsx --require babel/register

Generate HTML report

Report will go to coverage folder.

babel-istanbul report -v html

About

React base app with Webpack and Mocha/Chai testing

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published