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

Already on GitHub? Sign in to your account

Sinon.test incompatible with asynchronous tests #170

Closed
gpeal opened this Issue Aug 14, 2012 · 3 comments

Comments

Projects
None yet
4 participants

gpeal commented Aug 14, 2012

I wrapped one of my asynchronous tests with sinon.test and it no longer waits for done() to be called and instead returns true at the bottom of the function.

My test is in the format:

it('testname', sinon.test(function(done)  {
    //somestuff
}))

Are there any plans to handle asynchronous test functions? The functionality can be implemented, but it probably requires asynchronous trycatch.

Contributor

mroderick commented Aug 12, 2014

As far as I can tell, this is implemented in https://github.com/cjohansen/Sinon.JS/blob/master/lib/sinon/test.js#L19-L68 and verified in https://github.com/cjohansen/Sinon.JS/blob/master/test/sinon/test_test.js#L127-L133.

I am closing this issue.

Please re-open with a reproducible example (or even a failing test) if you disagree.

@mroderick mroderick closed this Aug 12, 2014

Contributor

altmind commented Sep 23, 2014

Yeah, I also struck this. Seems to be fixed in newest version of sinon.
Possibly related issues:
cjohansen#469
visionmedia/mocha#1252

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