Adam Bretz (arb, @adambretz)
Walmart Open Source Team (yes that's a real thing)
Battle tested
Easy to use + proper semantic versioning
Useful options and features
var Code = require('code');
var Lab = require('lab');
var lab = exports.lab = Lab.script();
var describe = lab.describe;
var it = lab.it;
var expect = Code.expect;
describe('math', function () {
it('returns true when 1 + 1 equals 2', function (done) {
expect(1+1).to.equal(2);
done();
});
});
var Code = require('code');
var Lab = require('lab');
var lab = exports.lab = Lab.script();
var suite = lab.suite;
var test = lab.test;
var expect = Code.expect;
suite('math', function () {
test('returns true when 1 + 1 equals 2', function (done) {
expect(1+1).to.equal(2);
done();
});
});
var settings = options || {};
var result = value > 0 ? value/100 : -1;
if (x && y && z) { console.log('true'); }
index.js:
Line 7: eol-last - Newline required at end of file but not found.
Line 1: func-style - Expected a function expression.
Line 3: space-infix-ops - Infix operators must be spaced.
Line 3: semi - Missing semicolon.
Verbose prints out the test verbiage including the test identifier.
math
✔ 1) sums numbers (2 ms)
✔ 2) does not crash on empty arrays (1 ms)
The test identifier can be used with the ID option to run only certain tests
lab -i 1-2
lab -i 1,2
expect(foo).to.exist;
expect(foo).to.exist();