Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

code error results in all tests passing #209

Closed
Trott opened this issue Sep 16, 2014 · 3 comments
Assignees
Labels
bug
Milestone

Comments

@Trott
Copy link

@Trott Trott commented Sep 16, 2014

See https://github.com/Trott/lab-issue-demo for a test file that exits with no output and a success code. It appears that coding errors in the tests can result in...uh...I guess this is a false negative?

Tested with lab 4.4.3.

@Trott

This comment has been minimized.

Copy link
Author

@Trott Trott commented Sep 16, 2014

And, to save you a click, here's the code with the issues. The first test should pass and the second one should fail.

var demo = require('../demo.js');

var Lab = require('lab');
var lab = exports.lab = Lab.script();

var expect = Lab.expect;
var describe = lab.experiment;
var it = lab.test;

describe('demo', function () {

    it('should export existing()', function (done) {
        expect(typeof demo.existing).to.equal('function');

        // If you leave out the done(), lab exits immediately with a success code even though the next test should fail.
        //done();

        // If the above line is uncommented, this past succeeds and subsequent tests fail, as expected.
    });

    it('should fail this test', function (done) {
        expect(false).to.be.ok;
        done();
    });
});

And the only line in the demo.js module imported on the first line:

exports.existing = function () {};
Marsup added a commit to Marsup/lab that referenced this issue Sep 16, 2014
@Marsup

This comment has been minimized.

Copy link
Member

@Marsup Marsup commented Sep 16, 2014

Did a PR for this one, full explanation there, this one was tricky !

@geek geek closed this in 5c5ba81 Sep 16, 2014
geek added a commit that referenced this issue Sep 16, 2014
Fix #209: omit undefined options
@geek geek added the bug label Sep 16, 2014
@geek geek self-assigned this Sep 16, 2014
@geek

This comment has been minimized.

Copy link
Member

@geek geek commented Sep 16, 2014

Published as v4.4.4

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants
You can’t perform that action at this time.