#Mocha
describe("an async spec", function(){
beforeEach(function(){
var done = false;
function doStuff(){
// simulate async stuff and wait 10ms
setTimeout(function(){
done = true;
}, 10);
}
runs(doStuff);
waitsFor(function(){
return done;
});
});
it("did stuff", function(){
expect(done).toBe(true);
});
});
describe("an async spec", function(){
beforeEach(function(done){
setTimeout(function(){
flag = true;
done();
}, 500);
});
it("did stuff", function(){
expect(flag).to.be(true);
});
});
http://chaijs.com/api/bdd/
https://github.com/shouldjs/should.js#chaining-assertions
https://github.com/pivotal/jasmine/wiki/Matchers
http://visionmedia.github.io/mocha/#string-diffs
http://visionmedia.github.io/mocha/#reporters
We can get rid of this:
I18n = require("../../../helpers/i18n_helper.js")
sessionHelper = require("../../../helpers/session_helper.js")
tabsHelper = require("../../../helpers/tab_helper.js")
Environment = require("../../../environments/local.json")
utils = require "../../../helpers/utils.js"
TableTester = require("../../../helpers/table_helper.js")
gridHelper = require("../../../helpers/grid_helper.js")
it "creates sample data", ->
# generate sample data
it "removes sample data", ->
# remove sample data
beforeAll ->
# generate sample data
# ... tests
afterAll ->
# remove sample data
http://www.techtalkdc.com/which-javascript-test-library-should-you-use-qunit-vs-jasmine-vs-mocha/
https://github.com/yeoman/yeoman/issues/117
https://github.com/angular/protractor/issues/350