Skip to content
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

don't destructure Ember.testing #1477

Merged
merged 1 commit into from
Nov 15, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
3 changes: 1 addition & 2 deletions addon/authenticators/oauth2-password-grant.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ import Ember from 'ember';
import BaseAuthenticator from './base';
import fetch from 'fetch';

const { testing } = Ember;
const assign = emberAssign || merge;
const keys = Object.keys || emberKeys; // Ember.keys deprecated in 1.13

Expand Down Expand Up @@ -347,7 +346,7 @@ export default BaseAuthenticator.extend({
if (!isEmpty(refreshToken) && !isEmpty(expiresAt) && expiresAt > now - offset) {
run.cancel(this._refreshTokenTimeout);
delete this._refreshTokenTimeout;
if (!testing) {
if (!Ember.testing) {
this._refreshTokenTimeout = run.later(this, this._refreshAccessToken, expiresIn, refreshToken, expiresAt - now - offset);
}
}
Expand Down
4 changes: 1 addition & 3 deletions addon/mixins/application-route-mixin.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,6 @@ import { inject } from '@ember/service';
import Ember from 'ember';
import Configuration from './../configuration';

const { testing } = Ember;

/**
The mixin for the application route, __defining methods that are called when
the session is successfully authenticated (see
Expand Down Expand Up @@ -139,7 +137,7 @@ export default Mixin.create({
@public
*/
sessionInvalidated() {
if (!testing) {
if (!Ember.testing) {
if (this.get('_isFastBoot')) {
this.transitionTo(Configuration.baseURL);
} else {
Expand Down
6 changes: 2 additions & 4 deletions addon/session-stores/cookie.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,6 @@ import Ember from 'ember';
import BaseStore from './base';
import objectsAreEqual from '../utils/objects-are-equal';

const { testing } = Ember;

const persistingProperty = function(beforeSet = function() {}) {
return computed({
get(key) {
Expand Down Expand Up @@ -253,7 +251,7 @@ export default BaseStore.extend({
this._lastData = data;
this.trigger('sessionDataUpdated', data);
}
if (!testing) {
if (!Ember.testing) {
cancel(this._syncDataTimeout);
this._syncDataTimeout = later(this, this._syncData, 500);
}
Expand All @@ -271,7 +269,7 @@ export default BaseStore.extend({
},

_renewExpiration() {
if (!testing) {
if (!Ember.testing) {
cancel(this._renewExpirationTimeout);
this._renewExpirationTimeout = later(this, this._renewExpiration, 60000);
}
Expand Down