Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

promise support for async before/after functions and tests #289

Open
jdavisclark opened this issue Feb 18, 2014 · 2 comments
Open

promise support for async before/after functions and tests #289

jdavisclark opened this issue Feb 18, 2014 · 2 comments

Comments

@jdavisclark
Copy link

Adding native support for promises in addition to the done() style callbacks for async before/after functions + tests would really improve the test writing/debugging experience for projects that depend on promises more so than node style callbacks. There are plenty of ways to make it work without native support, but nothing would beat it.

before/after functions:
In addition to signaling completion/failure of the before/after, it would be great if a promise returned from a before/after function that was rejected would cause the error passed to the reject handler to be logged to the console, and then fail every test in the immediate suite.

tests:
returning a promise from a test would simply signal test completion on resolution, or fail the test on rejection.

Has any of this been discussed or considered before?

@legomushroom
Copy link

👍 for this. Seems native jasmine done promise doesn't work for now. How do you even test async code in jasmine 2.0 without it?

@jrsinclair
Copy link

I'm seeing the same issues. Although done() should work in theory, it doesn't seem happy when used with the Bluebird promise library. Test execution just randomly stops mid-execution, but sometimes, for no apparent reason it works. Seems to be some kind of race condition going on.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants