From 8c1c0b211e4bba35548ae1d86b13d00105899318 Mon Sep 17 00:00:00 2001 From: "Ryan X. Charles" Date: Wed, 18 Jun 2014 09:32:19 -0700 Subject: [PATCH 1/2] remove console.log from test ...cluttering the console.log output looks bad and can be avoided using methods like this. --- test/test.WalletFactory.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/test/test.WalletFactory.js b/test/test.WalletFactory.js index abc82e4ec..f8799fd6b 100644 --- a/test/test.WalletFactory.js +++ b/test/test.WalletFactory.js @@ -49,10 +49,13 @@ describe('WalletFactory model', function() { var c2 = JSON.parse(JSON.stringify(config)); c2.verbose = 1; var wf = new WalletFactory(c2, '0.0.1'); + var save_console_log = console.log; + console.log = function() {}; var spy = sinon.spy(console, 'log'); wf.log('ok'); sinon.assert.callCount(spy, 1); spy.getCall(0).args[0].should.equal('ok'); + console.log = save_console_log; }); From 86633cd5b4b7a6555807ef12426afe8b44de8e58 Mon Sep 17 00:00:00 2001 From: Manuel Araoz Date: Wed, 18 Jun 2014 16:02:31 -0300 Subject: [PATCH 2/2] fix karma tests --- js/app.js | 1 - js/services/notifications.js | 2 +- test/unit/controllers/controllersSpec.js | 1 - test/unit/services/servicesSpec.js | 1 - 4 files changed, 1 insertion(+), 4 deletions(-) diff --git a/js/app.js b/js/app.js index 5dea3f699..703fcd1d5 100644 --- a/js/app.js +++ b/js/app.js @@ -24,7 +24,6 @@ var copayApp = window.copayApp = angular.module('copayApp',[ 'angularMoment', 'mm.foundation', 'monospaced.qrcode', - 'notifications', 'copayApp.filters', 'copayApp.services', 'copayApp.controllers', diff --git a/js/services/notifications.js b/js/services/notifications.js index c37aee391..1d75fb20c 100644 --- a/js/services/notifications.js +++ b/js/services/notifications.js @@ -1,6 +1,6 @@ 'use strict'; -angular.module('notifications', []). +angular.module('copayApp.services'). factory('$notification', ['$timeout',function($timeout){ var notifications = JSON.parse(localStorage.getItem('$notifications')) || [], diff --git a/test/unit/controllers/controllersSpec.js b/test/unit/controllers/controllersSpec.js index e8d281163..9ec356896 100644 --- a/test/unit/controllers/controllersSpec.js +++ b/test/unit/controllers/controllersSpec.js @@ -13,7 +13,6 @@ describe("Unit: Controllers", function() { var scope; - beforeEach(module('notifications')); beforeEach(module('copayApp.services')); beforeEach(module('copayApp.controllers')); diff --git a/test/unit/services/servicesSpec.js b/test/unit/services/servicesSpec.js index 64e9e713e..23086e7a9 100644 --- a/test/unit/services/servicesSpec.js +++ b/test/unit/services/servicesSpec.js @@ -61,7 +61,6 @@ describe("Unit: Walletfactory Service", function() { describe("Unit: controllerUtils", function() { beforeEach(angular.mock.module('copayApp.services')); - beforeEach(angular.mock.module('notifications')); it('should updateBalance in bits', inject(function(controllerUtils, $rootScope) { expect(controllerUtils.updateBalance).not.to.equal(null);