Closed tspeed90 closed 6 years ago
Mocha/Chai: https://hackmd.io/3U8LMOtSTEifnekvpYW_vQ Using Mocha with Supertest: http://willi.am/node-mocha-supertest/
A few example Mocha/Chai tests:
describe('mocha basics', () => {
it('true should be true', () => {
true.should.be.true;
});
it('true should be true', () => {
expect(true).to.be.true;
})
})
describe('Math', () => {
it('3*3 should equal 9', () => {
assert.equal(9, 3*3);
});
it('(3-4)*8=-8', () => {
assert.equal(-8, (3-4)*8);
})
});
Supertest docs: https://www.npmjs.com/package/supertest
30 minutes on Mocha/Chai and creating a scale (d3?)