This repository has been archived by the owner on Jan 4, 2018. It is now read-only.
Document the done()
contract
#24
Labels
done()
contract
#24
When I call
done()
passing a nonError
instance (let's say an error Object Literal, for instance) I get the following message:If the contract is that you should pass an
Error
instance to theasync
done
handler, then that should be documented. I couldn't find that when looking at the site, only looking at the internals (which, as we all know, should not be relied upon).If you pass a String (
done("it should not do this")
), according to the source, it is supposed to be casted accordingly, but then the result will be something like:That is interpreted as a mistake, but then the docs should reflect what should be done to prevent that mistake.
Below is the relevant piece of code from source (2.4.5):
TL DR;
Document that
done
accepts eitherundefined
oran Error object
to reflect the current undocumented behavior.The text was updated successfully, but these errors were encountered: