-
-
Notifications
You must be signed in to change notification settings - Fork 156
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
'pauseTest' doesn't reset the test timeout #496
Comments
Thank you for reporting!!! I took some time to dig into this issue the other day, and determine that the issue here is that when the test is an async function we have already returned a promise and qunit has already read the timeout value before you have a chance (in the test body) to set Specifically, this is the order of events today:
Proposed solution: We need to update QUnit's implementation of |
Writing all that up made me realize there is a temporary work around we can do until we get the fixes in QUnit: #497. |
The fix from @step2yeung landed in qunit@2.9.3. |
Follows-up emberjs#497 which introduced this because QUnit 2.8 didn't support changing an existing `assert.timeout()` by calling it again in the same test (it would leave the old one unchanged, and start a second timeout). This was fixed in QUnit 2.9.3, released in Oct 2019. The ember-qunit package declares a peer dependency on `qunit@2.13.0`, which should remove the need for this workaround. Ref emberjs#496.
In #291 the
pauseTest
method was updated in order to ignore the test timeout. However, this doesn't work as expected - puttingawait this.pauseTest();
somewhere in the test body doesn't actually prevent qunit to fail the test due to the timeout being hit. I found two workarounds:assert.timeout(-1);
in the beginning of the testThe thing is none of this options is stated in the corresponding comment in addon-test-support/ember-qunit/index.js. This is a very convenient feature, so it would be really great to either update the comment or fix the behaviour to match the expected one.
The text was updated successfully, but these errors were encountered: