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

t.end() gives false success on async tests #17

Closed
sindresorhus opened this issue May 1, 2015 · 1 comment
Closed

t.end() gives false success on async tests #17

sindresorhus opened this issue May 1, 2015 · 1 comment
Labels
bug current functionality does not work as desired

Comments

@sindresorhus
Copy link
Member

This is kinda critical as it gives false success when you use t.end() in an async callback.

See: sindresorhus/is-online#17 (comment)

Example this makes the tests pass, even though it's should have failed:

test(function (t) {
    asyncFn(function (err, isAFalseValue) {
        t.assert(isAFalseValue);
        t.end();
    });
});

This works however:

test(function (t) {
    t.plan(1);

    asyncFn(function (err, isAFalseValue) {
        t.assert(isAFalseValue);
    });
});
sindresorhus added a commit that referenced this issue May 1, 2015
@sindresorhus
Copy link
Member Author

Added a test for this, which seems to pass, so might have been fixed after the really old currently published version.

@sindresorhus sindresorhus added the bug current functionality does not work as desired label May 3, 2015
sindresorhus added a commit that referenced this issue Sep 8, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug current functionality does not work as desired
Projects
None yet
Development

No branches or pull requests

1 participant