Make waitsForPromise() work with es6 promises as well as Q promises.
Esse commit está contido em:
@@ -298,13 +298,13 @@ window.waitsForPromise = (args...) ->
|
|||||||
window.waitsFor timeout, (moveOn) ->
|
window.waitsFor timeout, (moveOn) ->
|
||||||
promise = fn()
|
promise = fn()
|
||||||
if shouldReject
|
if shouldReject
|
||||||
promise.fail(moveOn)
|
promise.catch(moveOn)
|
||||||
promise.done ->
|
promise.then ->
|
||||||
jasmine.getEnv().currentSpec.fail("Expected promise to be rejected, but it was resolved")
|
jasmine.getEnv().currentSpec.fail("Expected promise to be rejected, but it was resolved")
|
||||||
moveOn()
|
moveOn()
|
||||||
else
|
else
|
||||||
promise.done(moveOn)
|
promise.then(moveOn)
|
||||||
promise.fail (error) ->
|
promise.catch (error) ->
|
||||||
jasmine.getEnv().currentSpec.fail("Expected promise to be resolved, but it was rejected with #{jasmine.pp(error)}")
|
jasmine.getEnv().currentSpec.fail("Expected promise to be resolved, but it was rejected with #{jasmine.pp(error)}")
|
||||||
moveOn()
|
moveOn()
|
||||||
|
|
||||||
|
|||||||
Referência em uma Nova Issue
Bloquear um usuário