Skip to content

Instantly share code, notes, and snippets.

@deanmarano
Created February 22, 2016 21:12
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save deanmarano/a6125f29cfd04e9ad0fc to your computer and use it in GitHub Desktop.
Save deanmarano/a6125f29cfd04e9ad0fc to your computer and use it in GitHub Desktop.
Promise Support for Jasmine
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