Closed anba closed 10 years ago
That's a hazard of the clever way mocha tries to handle synchronous and asynchronous tests, and is made worse (sorry, @domenic) by the way it now magically handles Promise
return values as well. it's easy to forget to declare done
and/or return your Promise
.
In case it helps, this is the "safety net" I built for prfun
to prevent this class of mistakes: https://github.com/cscott/prfun/commit/d204abb73d9453f25651e01d7a66f2a15d43dbde
The third test case in test/race.js ("should settle in the same way as the first promise to settle") does not declare the
done
parameter.