개요
가장 최근에 나온 자바스크립트 BDD 테스트 프레임워크(https://mochajs.org/)
예제
설치
npm install --global mocha
CODE
$ npm install mocha
$ mkdir test
$ $EDITOR test/test.js # or open with your favorite editor
CODE
test.js
var assert = require('assert');
describe('Array', function() {
describe('#indexOf()', function() {
it('should return -1 when the value is not present', function() {
assert.equal(-1, [1,2,3].indexOf(4));
});
});
});
JS
./node_modules/mocha/bin/mocha
CODE