-
Notifications
You must be signed in to change notification settings - Fork 26
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
Add failing spec for When with done() and Then with no done() #45
Conversation
We've definitely seen some weirdness around this in the past. I'm genuinely curious to know what the root cause is. I won't have time this week to look at it, would you be willing to take a stab at it? Also, are you interested in just being made a contributor to the project? I think you're the biggest contrib after myself. |
Unfortunately no time for me this week either. Maybe later...
I don't really expect to contribute much more, mostly just keep using it :) Unless I do get a chance to look into this done() weirdness before you do. But in any case if I did have something to contribute I'd want to run it by you first, so little difference whether ultimately I'm the one to press "merge this PR" or you are. So whatever you think best. Thanks. |
I've just run into this. I think the problem is that |
Thanks @phopkins, would you have a few minutes to attempt a PR to refactor it? |
Fix should be just to remove the call from that place. I'll spend some time On Thursday, January 7, 2016, Justin Searls [email protected]
|
@phopkins -- well, that's certainly enough to pass @ronen's test. I have to admit I don't remember writing any of this implementation at all and find it super dense to look at now. If I know me, the reason I wrapped the top layer was to avoid the situation that every I'm trying to think back on the original intent here — does the async support only work if you're on Jasmine 2.x, since that's the one which introduced the |
Landed in 2.6.4 Prithy that nothing blows up i guess. |
Sweet, thanks for the quick turnaround! I don't know how Jasmine 2.0 will react with everything being async, whether that's going to be slower or worse or not. This change should be a no-op for 1.3, since it wasn't affected by the arity at all. |
Hey @phopkins @ronen is it possible that merging this in broke Master under Node.js? https://travis-ci.org/searls/jasmine-given#L407 |
Looks like this change fixed the wrong behavior that the test was measuring. It seems to have been saying that if you had a synchronous “Then” followed by an async “Done,” that the “Done” would never be evaluated, which I think is counter-intuitive. |
@phopkins so what do you think we should do? |
Probably update the test. The new behavior seems better, no? On Tue, Feb 16, 2016 at 8:19 PM, Justin Searls [email protected]
|
In my app, I tried something like
But somehow my expectation never gets run, and Jasmine writes an error to the console:
I thought I'd try to debug it in jasmine-given, so started by adding a spec to test When(done) followed by Then [no done]. I thought that the spec would fail because the then() spy wasn't called. The spec does fail, but it reports that the done() spy wasn't called!
I'm not sure what's going on, and unfortunately don't have the time right now to dive into debugging it.
But I figured I'd at least bring it to your attention.