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

Warn if a test uses async code in a synchronous test #5

Open
lo1tuma opened this issue Jan 22, 2015 · 0 comments
Open

Warn if a test uses async code in a synchronous test #5

lo1tuma opened this issue Jan 22, 2015 · 0 comments
Labels

Comments

@lo1tuma
Copy link
Owner

lo1tuma commented Jan 22, 2015

This should be considered as a warning:

it('foo', function () {
    anyAsyncFunction(function (error, result) {
        expect(result).to.be.ok;
    });
});

it('foo', function () {
    anyAsyncFunction()
        .then(function (result) {
            expect(result).to.be.ok;
        });
});

This should not be considered as a warning:

it('foo', function (done) {
    anyAsyncFunction(function (error, result) {
        expect(result).to.be.ok;
        done();
    });
});

it('foo', function (done) {
    anyAsyncFunction()
        .then(function (result) {
            expect(result).to.be.ok;
            done();
        });
});

it('foo', function () {
    return anyAsyncFunction()
        .then(function (result) {
            expect(result).to.be.ok;
        });
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant