hapijs / hoek

Node utilities shared among the extended hapi universe
Other
481 stars 171 forks source link

Add returnValue option to wait() #359

Closed kanongil closed 4 years ago

kanongil commented 4 years ago

The new block() test can be simplified by adding a returnValue to Hoek.wait(), so I did an implementation.

I also added some proper tests for wait(), and changed it to only support numbers or undefined for the timeout option. This means that it now throws, if eg. an object is passed.