Skip to content

Instantly share code, notes, and snippets.

@Marsup
Last active August 29, 2015 14:16
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 Marsup/126943747d55abf59e40 to your computer and use it in GitHub Desktop.
Save Marsup/126943747d55abf59e40 to your computer and use it in GitHub Desktop.
Weird lab bug
it('fails', function (done) {
var script = Lab.script();
script.experiment('test', function () {
script.test('1', function (finished) {
throw new Error('die');
});
});
Lab.report(script, { output: false, assert: {} }, function (err, code, output) {
expect(code).to.equal(0);
done();
});
});
@geek
Copy link

geek commented Mar 4, 2015

Here is an alternative that passes... so is the issue only when running report ?

// Load modules

var Code = require('code');
var _Lab = require('../test_runner');
var Lab = require('../');


// Test shortcuts

var lab = exports.lab = _Lab.script();
var describe = lab.describe;
var it = lab.it;
var beforeEach = lab.beforeEach;

describe('test', function () {

    beforeEach(function (done) {

        setTimeout(done, 100);
    });

    it('1', function (done) {

        setTimeout(function () {

            throw new Error('die');
        }, 100);
    });
});

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment