Backbone TodoMVC example with mocha tests based on a frontend boilerplate.
Frontend boilerplate modified from generator-frontend.
- Local Connect web-server
- Live reload
- Compiling Jade templates to HTML
- Compiling Stylus
- Prefixing your output CSS with Autoprefixer
- Spriting with output to sprites.styl file(grunt-spritesmith)
- CSS linting
- Compile CJS modules with Browserify
- Concat Bower components
- CSS and JS minification(csso: better CSS minification)
- Image optimization
- Mocha scaffold
- Make sure you have Grunt installed:
npm install -g grunt-cli
- Install packages:
npm install & bower install
- Run:
grunt
start a connect server with live reload, and watch for compiling
To run the example:
With connect server running, open localhost:9001
.
The JavaScript source code have been migrated to CJS modules.
Seperated view templates under ./src/js/templates
, required into js code by
browserify with brfs transform.
Mocha + Chai + Sinon
./src/js/test/app.js
exported global variables for testing(compiled to ./test/
by browserify).
Run tests:
grunt mocha
Or run directly in browser: open ./test/index.html
.