Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/hulufei/backbone-mocha-example
Backbone TodoMVC example with mocha tests based on a frontend boilerplate(browserify etc.)
https://github.com/hulufei/backbone-mocha-example
Last synced: 2 days ago
JSON representation
Backbone TodoMVC example with mocha tests based on a frontend boilerplate(browserify etc.)
- Host: GitHub
- URL: https://github.com/hulufei/backbone-mocha-example
- Owner: hulufei
- Created: 2013-09-03T06:23:51.000Z (about 11 years ago)
- Default Branch: master
- Last Pushed: 2013-10-11T13:25:38.000Z (about 11 years ago)
- Last Synced: 2023-03-24T12:10:04.369Z (over 1 year ago)
- Language: JavaScript
- Homepage:
- Size: 301 KB
- Stars: 12
- Watchers: 1
- Forks: 6
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
backbone-mocha-example
=======================[Backbone TodoMVC](http://todomvc.com/architecture-examples/backbone/) example with mocha tests based on a frontend boilerplate.
Frontend boilerplate modified from [generator-frontend](https://github.com/nDmitry/generator-frontend).
## Include
- Local Connect web-server
- Live reload
- Compiling Jade templates to HTML
- Compiling Stylus
- Prefixing your output CSS with [Autoprefixer](https://github.com/nDmitry/grunt-autoprefixer)
- Spriting with output to sprites.styl file([grunt-spritesmith](https://github.com/Ensighten/grunt-spritesmith))
- CSS linting
- Compile CJS modules with [Browserify](https://github.com/substack/node-browserify)
- Concat Bower components
- CSS and JS minification([csso](https://github.com/t32k/grunt-csso): better CSS minification)
- Image optimization
- Mocha scaffold## Getting started
- Make sure you have [Grunt](http://gruntjs.com) 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](https://github.com/substack/brfs) transform.### Tests
Mocha + Chai + Sinon
`./src/js/test/app.js` exported global variables for testing(compiled to `./test/` by browserify).
Run tests:
```shell
grunt mocha
```Or run directly in browser: open `./test/index.html`.