Accept timeout option to waitsForPromise

This commit is contained in:
Kevin Sawicki
2013-09-23 16:44:59 -07:00
parent 36345185b5
commit 869fe71f73

View File

@@ -160,12 +160,12 @@ window.mousemoveEvent = (properties={}) ->
window.waitsForPromise = (args...) ->
if args.length > 1
{ shouldReject } = args[0]
{ shouldReject, timeout } = args[0]
else
shouldReject = false
fn = _.last(args)
window.waitsFor (moveOn) ->
window.waitsFor timeout, (moveOn) ->
promise = fn()
if shouldReject
promise.fail(moveOn)