Skip to content

Instantly share code, notes, and snippets.

@blacksun1
Last active September 7, 2016 13:33
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save blacksun1/9c1f5c6d1e2a72227d71e96f13f577b8 to your computer and use it in GitHub Desktop.
Save blacksun1/9c1f5c6d1e2a72227d71e96f13f577b8 to your computer and use it in GitHub Desktop.
Lab test for using
'use strict';
// Load modules
const Lab = require('lab');
// Test shortcuts
const lab = exports.lab = Lab.script();
const describe = lab.describe;
const it = lab.it;
const expect = Lab.assertions.expect;
const fail = Lab.assertions.fail;
describe('expectation', () => {
it('Test should pass but get marked as having a missing expectation', (done) => {
expect(true).to.be.false;
done();
});
it('should be able to expect', (done) => {
expect(true).to.be.true();
done();
});
it('should be able to fail (This test should fail)', (done) => {
fail('Should fail');
done();
});
});
{
"name": "9c1f5c6d1e2a72227d71e96f13f577b8",
"version": "1.0.0",
"description": "",
"main": "brokenTest.js",
"scripts": {
"test": "lab --lint --assert code 'brokenTest.js'"
},
"repository": {
"type": "git",
"url": "git+ssh://git@gist.github.com/9c1f5c6d1e2a72227d71e96f13f577b8.git"
},
"author": {
"name": "Simon Bruce",
"email": "blacksun1@users.noreply.github.com",
"url": "https://blog.blacksun.cx"
},
"license": "MIT",
"bugs": {
"url": "https://gist.github.com/9c1f5c6d1e2a72227d71e96f13f577b8"
},
"homepage": "https://gist.github.com/9c1f5c6d1e2a72227d71e96f13f577b8",
"devDependencies": {
"code": "^3.0.2",
"lab": "^11.0.1"
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment