Created
February 22, 2016 21:12
-
-
Save deanmarano/a6125f29cfd04e9ad0fc to your computer and use it in GitHub Desktop.
Promise Support for Jasmine
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
itPromises = (testName, testFn) -> | |
it testName, (done) -> | |
promise = testFn() | |
if typeof promise.then == 'function' | |
promise.then(done, -> | |
fail("Promise was rejected - #{JSON.stringify(arguments)}") | |
) | |
else | |
fail('specs with itPromises needs to return a promise') | |
done() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment