how to set up one testing system for both front-end and backend

Huge working in progress because I haven’t figured everything out yet.

Unit test is:
– fixed input
– expected a fixed output

Testing frameworks:
– Mocha
– Jasmine

Assertion libraries:
– Chai

//backend code
var expect = require('chai').expect;

var _ = {};
if(typeof module !== 'undefined'){
  module.exports = _;

How to set up mocha:

npm install -g mocha
npm install chai mocha
#put the following code in mocha.opts
#mocha --reporter spec

The directory structure:

???not sure???
In browser:

var expect = chai.expect;

To test async code in mocha, use done()

it('should test async function', function(done){
	}, 500)

Third party services:
– Travis-ci
– code-coverage, whether that particular line of code has been run in the test
– selenium
– browserling