-
-
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
Ember.testing
set inconsistently
#297
Comments
Awesome, thank you for reporting. I think the right solution is to add a |
Hi @rwjblue, thanks for working on this, after updating I've found one case in our test suite which fails ( // app/utils/debounce.js
import Ember from 'ember';
const debounce = Ember.testing ? 0 : 500;
export default debounce; // tests/unit/utils/debounce-test.js
import debounce from 'app/utils/debounce';
import { module, test } from 'qunit';
module('Unit | Utility | debounce');
test('it works', function(assert) {
assert.equal(debounce, 0);
}); Not sure if it's a valid usage of |
Sorry this is biting you, but checking It seems like what you are actually trying to do is ensure that whenever in the testing environment that you use a very short debounce value. A more semantic alternative for your use case would be something like: import config from `../config/environment’;
const debounce = config.environment === ‘test’ ? 0 : 500;
export default debounce; Hope that helps! |
@rwjblue, thanks for clarification! Your solution works like a charm |
After speaking with and debugging code with @rwjblue we seem to have discovered that a regression was introduced by emberjs/ember-test-helpers#227 in which
Ember.testing
is now no longer consistently set totrue
when testing.If you use a vanilla qunit
module
, rather thanmoduleFor
fromember-qunit
Ember.testing
isfalse
most of the time. It is inconsistent though and depends on the timing of when the test is run.The text was updated successfully, but these errors were encountered: