A simple starter template for a React ES6 web app, companion to Getting Started with React & ES6.
This project and article demonstrates:
- How to get started with ES6 code using a combination of Webpack and Babel
- How to handle ESX transpilation
- A simple method to support unit tests for your application
- Code Coverage for ES6
Check the code out, npm install
and then npm start
!
git clone git@github.com:dwmkerr\react-es6-starter.git
cd react-es6-starter
npm install
npm start
You can run the tests with:
npm test
Heroku
The repo will deploy to Heroku as-is with no modifitications.
To keep the repository as clean as possible I've left out the Procfile
required to run with Heroku locally. However, if you need to do this, just
add a file in the root of the repository named Procfile
with the contents:
web: ./node_modules/.bin/http-server
Some useful material:
Testing
- How to easily test React components with Karma and Webpack
- How to implement testing and code coverage on React with Karma, Babel and Webpack
General
- https://medium.com/@gunnarlium/es6-code-coverage-with-babel-jspm-karma-jasmine-and-istanbul-2c1918c5bb23
- http://kentor.me/posts/testing-react-and-flux-applications-with-karma-and-webpack/
- https://github.com/binarykitchen/gulp-jest-iojs/issues/1
- http://www.hammerlab.org/2015/02/14/testing-react-web-apps-with-mocha/