Add waitForSettled support and use latests ember-test-helpers#633
Add waitForSettled support and use latests ember-test-helpers#633yads wants to merge 7 commits intoemberjs:masterfrom
Conversation
* add capability to send waitForSettled option to the teardownContext function same as ember-qunit
update from upstream
* upgrade various dependencies * update ember-try list to include latest LTS versions * fix various deprecated features
* drop support for options in ember-cli-mocha namespace * update it-test * allow specifying options to the mocha runner
it looks like the new teardown in ember-test-helpers is working where this is no longer required
| /** | ||
| Ensures that `Ember.testing` is set to `true` before each test begins | ||
| (including `before` / `beforeEach`), and reset to `false` after each test is | ||
| completed. This is done via `beforeEach` and `afterEach`. | ||
| */ | ||
| export function setupEmberTesting() { | ||
| beforeEach(function() { | ||
| Ember.testing = true; | ||
| }); | ||
|
|
||
| afterEach(function() { | ||
| Ember.testing = false; | ||
| }); | ||
| } |
There was a problem hiding this comment.
We should not need to add this code. It should be handled by @ember/test-helpers
Also, before should not have Ember.testing === true, only while running an actual test (e.g. beforeEach).
|
|
||
| // copy over the original values | ||
| _assign(this, originalContext); | ||
| Object.assign(this, originalContext); |
There was a problem hiding this comment.
Are we explicitly dropping IE11 support in this release? IMHO, that should be decoupled from updating @ember/test-helpers.
There was a problem hiding this comment.
@rwjblue would the babel transpiler not handle this for us?
There was a problem hiding this comment.
@rwjblue would the babel transpiler not handle this for us?
No, not by default. It is possible to configure this to transpile into core-js poly fills, but that requires the application has the polyfill installed/configured (which we can't assume). Additionally, we can't force the app to add the polyfill only in tests because then tests would pass in browsers that would never actually work in production/deployment.
There was a problem hiding this comment.
So unfortunately with the Proxy solution in order to support the latest test-helpers we will either have to drop IE support or use https://github.com/GoogleChrome/proxy-polyfill. LMK if it still makes sense to decouple these.
There was a problem hiding this comment.
@rwjblue let me know what you would like to do regarding this? Should I use the proxy-polyfill or should we just drop IE support in this PR?
| 'ember/new-module-imports': 'off', | ||
| 'ember/no-restricted-resolver-tests': 'off', | ||
| 'ember/no-test-import-export': 'off', | ||
| 'ember/no-ember-testing-in-module-scope': 'off' |
There was a problem hiding this comment.
We should not turn this rule off. The thing it is flagging is correct. Ember.testing should never be set during module evaluation.
|
Will update and ping you. |
Update feature list to bring it inline with ember-qunit feature parity including
waitForSettledoption support, latesst ember-test-helpers support and update to use latest mocha.If you'd like to use these features now, This is from a maintained fork over https://github.com/yads/ember-mocha/