GitXplorerGitXplorer
h

backbone-mocha-example

public
12 stars
6 forks
0 issues

Commits

List of commits on branch master.
Unverified
7992c1e7ca150a020d3b057e280e34f0aa5bc5c3

Change pngmin to imagemin

hhulufei committed 11 years ago
Unverified
9a05da770ea62fbe7e38dc74dc05d166803c1a76

Merge branch 'master' of https://github.com/hulufei/backbone-mocha-examples

hhulufei committed 11 years ago
Unverified
31f7bd83ef531b814ead9e232d7f27938c64ffdb

Minor changes

hhulufei committed 11 years ago
Unverified
b14acb74711e7b1ba91dc33583ba3a57fc7590ea

Minor correction

hhulufei committed 11 years ago
Unverified
a20d9e5e96fe6be517b6af48f7286f951b5977b6

Introduction

hhulufei committed 11 years ago
Unverified
a9236c41b65540592d7a68b878f78f2b88afe95f

Tab to space

hhulufei committed 11 years ago

README

The README file for this repository.

backbone-mocha-example

Backbone TodoMVC example with mocha tests based on a frontend boilerplate.

Frontend boilerplate modified from generator-frontend.

Include

  • 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

Getting started

  • 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

Todo Example

To run the example:

With connect server running, open localhost:9001.

Browserify

The JavaScript source code have been migrated to CJS modules.

View Templates

Seperated view templates under ./src/js/templates, required into js code by browserify with brfs transform.

Tests

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.