Remove logic for different promise types in waitsForPromise

I added that logic when using the selenium-webdriver library, but
then switched to using webdriverio, which has the same Promise
interface as Q.
This commit is contained in:
Max Brunsfeld
2015-02-09 14:22:11 -08:00
parent 79d0f296e0
commit 3e28eff755

View File

@@ -305,13 +305,13 @@ window.waitsForPromise = (args...) ->
window.waitsFor timeout, (moveOn) ->
promise = fn()
if shouldReject
(promise.catch ? promise.thenCatch).call(promise, moveOn)
promise.catch.call(promise, moveOn)
promise.then ->
jasmine.getEnv().currentSpec.fail("Expected promise to be rejected, but it was resolved")
moveOn()
else
promise.then(moveOn)
(promise.catch ? promise.thenCatch).call promise, (error) ->
promise.catch.call promise, (error) ->
jasmine.getEnv().currentSpec.fail("Expected promise to be resolved, but it was rejected with #{jasmine.pp(error)}")
moveOn()