From 6190ba29db2f81b17a2a554f65da30a9febfa809 Mon Sep 17 00:00:00 2001 From: snewcomer Date: Fri, 30 Nov 2018 09:31:02 -0800 Subject: [PATCH 1/3] Replace logger with console.log --- app/initializers/ember-stripe-service.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/initializers/ember-stripe-service.js b/app/initializers/ember-stripe-service.js index e3a729f..faf6e56 100644 --- a/app/initializers/ember-stripe-service.js +++ b/app/initializers/ember-stripe-service.js @@ -13,7 +13,7 @@ export function initialize() { application.inject('service:stripe', 'config', 'config:stripe'); if (stripeConfig.debug) { - Ember.Logger.info('StripeService: initialize'); + console.log('StripeService: initialize'); } if (!stripeConfig.publishableKey) { From 48aeff26615ef2dfa094268f17085d2d8959245e Mon Sep 17 00:00:00 2001 From: snewcomer Date: Fri, 30 Nov 2018 09:46:40 -0800 Subject: [PATCH 2/3] fix lint --- app/initializers/ember-stripe-service.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/initializers/ember-stripe-service.js b/app/initializers/ember-stripe-service.js index faf6e56..baf2d39 100644 --- a/app/initializers/ember-stripe-service.js +++ b/app/initializers/ember-stripe-service.js @@ -1,5 +1,4 @@ import EmberError from '@ember/error'; -import Ember from 'ember'; import StripeMock from 'ember-stripe-service/utils/stripe-mock'; import config from '../config/environment'; @@ -13,6 +12,7 @@ export function initialize() { application.inject('service:stripe', 'config', 'config:stripe'); if (stripeConfig.debug) { + /* eslint-disable no-console */ console.log('StripeService: initialize'); } From 95a3510d02e39b84e4abadc24921ae9dfc00e1b0 Mon Sep 17 00:00:00 2001 From: snewcomer Date: Fri, 30 Nov 2018 10:29:26 -0800 Subject: [PATCH 3/3] fix tests --- tests/acceptance/initializer-logging-test.js | 3 +-- tests/unit/initializers/ember-stripe-service-test.js | 7 ++++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/tests/acceptance/initializer-logging-test.js b/tests/acceptance/initializer-logging-test.js index 3b82a37..cba4161 100644 --- a/tests/acceptance/initializer-logging-test.js +++ b/tests/acceptance/initializer-logging-test.js @@ -1,12 +1,11 @@ import { module, test } from 'qunit'; import { setupTest } from 'ember-qunit'; -import Ember from 'ember'; import sinon from 'sinon'; import config from 'dummy/config/environment'; module('Acceptance | Initializer logging', function(hooks) { hooks.beforeEach(function() { - this.info = sinon.stub(Ember.Logger, 'info'); + this.info = sinon.stub(console, 'log'); this._original_LOG_STRIPE_SERVICE = config.LOG_STRIPE_SERVICE; }); diff --git a/tests/unit/initializers/ember-stripe-service-test.js b/tests/unit/initializers/ember-stripe-service-test.js index ab32d74..5c3930c 100644 --- a/tests/unit/initializers/ember-stripe-service-test.js +++ b/tests/unit/initializers/ember-stripe-service-test.js @@ -1,4 +1,3 @@ -import Ember from 'ember'; import sinon from 'sinon'; import { module, test } from 'qunit'; import { initialize } from 'dummy/initializers/ember-stripe-service'; @@ -12,7 +11,8 @@ module('Unit | Initializer | Stripe Service Initializer', function(hooks) { test('it logs when LOG_STRIPE_SERVICE is set in env config', function(assert) { env.LOG_STRIPE_SERVICE = true; - let info = sinon.stub(Ember.Logger, 'info'); + /* eslint-disable no-console */ + let info = sinon.stub(console, 'log'); initialize(this.owner.__container__, this.owner); assert.ok(info.calledWith('StripeService: initialize')); @@ -23,7 +23,8 @@ module('Unit | Initializer | Stripe Service Initializer', function(hooks) { env.LOG_STRIPE_SERVICE = true; env.stripe.debug = undefined; // act like this was never set - let info = sinon.stub(Ember.Logger, 'info'); + /* eslint-disable no-console */ + let info = sinon.stub(console, 'log'); initialize(this.owner.__container__, this.owner); let stripeConfig = this.owner.__container__.lookup('config:stripe');