Async: Implement new assert.async mechanism#653
Conversation
|
For QUnit |
There was a problem hiding this comment.
use pushFailure instead, if there's no current test it's the best option here
There was a problem hiding this comment.
OK, just a holdover from the existing code.
|
I'm missing also the deprecation messages on |
|
I also vote for deprecating For |
|
To make tests async by default, we would need to either:
QUnit.test( "x", function( assert, done ) {
/* ... */
done();
});
|
|
also as anyway, let's bring this 2.0.0 discussion to another issue so here we can focus on the changes on this PR. |
|
Added deprecation warnings for |
That's not really what I suggested (I hope). With the two approaches we're going for now, I don't think we really need something else. The third approach would be to make assert.expect() trigger an async test, then running the specified of assertions ending the test. That wouldn't work for expect(0), which we currently support. There's probably more reasons why this isn't great, at least in the context of our existing APIs. |
|
Please ignore style issues with lines that are too long until #654 is addressed, which will help fix these. That kind of issue is just distracting from the important parts here. |
|
Other than that, \o/ \o/ \o/ This is great. |
|
Thanks, @gibson042! @jzaefferer @leobalter @Krinkle: Did you guys want to review this PR further? I'm not sure I have anyone's stamp of approval yet. |
|
LGTM, so I reported only few style issues I saw |
|
@leobalter: All fixed, and a few more. |
|
So @leobalter and @gibson042 have approved now. @jzaefferer @Krinkle @scottgonzalez, did any of you want to review this further before it gets merged? Forewarning: The Promise PR (#634) will be ready for rebasing for further review and/or merging immediately after this one is merged, so you should also go review that one (which contains this PR as well) before I have to pester you. 😜 |
There was a problem hiding this comment.
This should be fine, but since this property was never in the public API, it's not really necessary. I also see no reason why something outside QUnit should ever fiddle with this, except as workarounds.
There was a problem hiding this comment.
Removed, per implementation of #653 (comment)
There was a problem hiding this comment.
Calling start() again here doesn't cause any failure. It should, and it does in master.
There was a problem hiding this comment.
I added a test for it locally and it does cause a failure for me, so...?
There was a problem hiding this comment.
Added many tests for the various start/stop error scenarios mentioned in #653 (comment)
|
Overall looking very promising. No game-breaker, just some details that we need to iron out. No need to discuss |
|
The new commit implemented all of the error scenario rules for |
assert.async mechanism|
LGTM |
Also adds minor test cleanup Fixes #659
Fixes #534.
Typical Usage Example:
This PR should now be merged before #634 (which I will then rebase).