You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Useful in specs, to wait for condition to became true,
it"job should be finished"->startSomeAsyncJob()
# Expecting job to be finished at some point in future.wait->expect(isJobFinished()).to.eqltrue# It's also possible to implement more elegant version with promises, but it's # incompatible with Node.js async convention.expect(isJobFinished()).to.eventually.eqltrue
# Wait until function called without exception.waitTimeout=3000waitInterval=5wait= (arg) ->if_(arg).isFunction()
func= arg
startTime=moment().valueOf()
whiletruetryreturnfunc()
catch err
currentTime=moment().valueOf()
if (currentTime - startTime) < waitTimeout
setTimeoutsync.defer(), waitInterval
sync.await()
elsethrow err
elsetime= arg
setTimeoutsync.defer(), time
sync.await()
The text was updated successfully, but these errors were encountered:
Useful in specs, to wait for condition to became true,
The text was updated successfully, but these errors were encountered: