Repository navigation
Update ember-testing tests to new syntax - #16022
Conversation
| ['@test asyncStart calls stop'](assert) { | ||
| var originalStop = QUnit.stop; | ||
| try { | ||
| QUnit.stop = function() { |
There was a problem hiding this comment.
I'm not very sure what to do about QUnit.stop and QUnit.start
There was a problem hiding this comment.
The places that are explicitly testing asyncStart and asyncStop should continue to use QUnit.stop / QUnit.start for now, but anywhere else it is being done should be migrated to assert.async().
| } finally { | ||
| QUnit.start = originalStart; | ||
| ['@test asyncEnd calls start'](assert) { | ||
| var originalStart = QUnit.start; |
| var error = { err: 'hai' }; | ||
| var originalOk = window.ok; | ||
| try { | ||
| window.ok = function(val, msg) { |
There was a problem hiding this comment.
This is also unclear.
There was a problem hiding this comment.
I have some tests for this in ember-qunit, basically you should do:
let originalPushResult = assert.pushResult;
assert.pushResult = function(resultInfo) {
// Inverts the result so we can test failing assertions
resultInfo.result = !resultInfo.result;
resultInfo.message = `Failed: ${resultInfo.message}`;
originalPushResult(resultInfo);
};| return new RSVP.Promise(function(resolve) { | ||
| QUnit.stop(); // raw async, we must inform the test framework manually | ||
| setTimeout(function() { | ||
| QUnit.start(); // raw async, we must inform the test framework manually |
There was a problem hiding this comment.
Should use assert.async(); here
|
@cibernox - Had any time to work on this? |
|
I do now. TBH, i just forgot about this PR 😅 |
d7be5d5 to
b9a40bb
Compare
| }, | ||
| exception(error) { | ||
| ok(false, inspect(error)); | ||
| ok(false, inspect(error)); // How do we access assert.ok here? |
There was a problem hiding this comment.
@rwjblue Should I use QUnit.assert.ok here instead?
bc34812 to
ca004d3
Compare
|
@rwjblue ready |
Part of #15988