Awesome
ES6 Karma Jasmine Webpack Boilerplate
should be red because example is purposely not fully covered
No Grunt/Gulp required!
Boilerplate for building a client-based JavaScript library in ES6 using the following features
Table of Contents
Configure
- Change package.json main field to your library_name.js
- Change package.json build scripts from Calculator to your library_name.js
- Change webpack.config.base.js library field from calculator to your library_name
- Make your library while
npm run test:dev
is executing - Setup Travis CI
- Setup Coveralls.io
- Setup saucelabs
- Added the
SAUCE_USERNAME
andSAUCE_ACCESS_KEY
enviroment variables to Travis CI - Update sauceLaunchers in saucelab_browsers.js
- Push code to github to share (should trigger Travis, sauceLabs, and Coveralls)
Features
- Webpack
- Karma
- Mocha w/ chai, sinon-chai, and chai-as-promised
- Rewire enabled
- PhantomJS and Chrome
- Code coverage reports
- Uploading to coveralls (https://github.com/caitp/karma-coveralls)
- Babel (
^6.3.0
)- babel-plugin-transform-runtime so transforms aren't inlined
- babel-istanbul
- ESLint
- Uses airbnb/base plus some additional good rules
Usage
npm run test
- Runs unit tests with Karma and generates a coverage reportnpm run test:dev
- Runs Karma and watches for changes to re-run tests also runs view-coveragenpm run test:web
- same as test but runs them in Chromenpm run test:dev:web
- same as test:dev but runs them in Chromenpm run view-coverage
- Runs a watching server on the code coverage folder and opens it at port 3001npm run lint
- Lint all.js
files.npm run lint:fix
- Lint and fix all.js
files. Read more on this.npm run clean
- removes the dist and build foldersnpm run build
- produces your library