Skip to content

Commit

Permalink
don't destructure Ember.testing
Browse files Browse the repository at this point in the history
  • Loading branch information
marcoow committed Nov 14, 2017
1 parent 89094c2 commit 6d2dd7b
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 9 deletions.
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

0 comments on commit 6d2dd7b

Please sign in to comment.