diff --git a/app/account/logout/logout.spec.js b/app/account/logout/logout.spec.js index 8926430c1..da1f544b0 100644 --- a/app/account/logout/logout.spec.js +++ b/app/account/logout/logout.spec.js @@ -4,6 +4,11 @@ import angular from 'angular' describe('Logout Controller', function() { var controller var fakeWindow = { + // Without the `angular` field our fake window will crush + // `angular-mocks@1.6.2` and higher! + angular: { + callbacks: {} + }, location: { href: '' } @@ -15,14 +20,11 @@ describe('Logout Controller', function() { angular.mock.module('tc.account', function($provide) { $provide.value('$window', fakeWindow) }) - bard.inject(this, '$controller', 'TcAuthService', '$window', '$q', 'CONSTANTS') - bard.mockService(TcAuthService, { logout: $q.when({}), _default: $q.when({}) }) - controller = $controller('LogoutController') }) diff --git a/app/services/helpers.service.spec.js b/app/services/helpers.service.spec.js index 9e1757f6f..2508bfe9f 100644 --- a/app/services/helpers.service.spec.js +++ b/app/services/helpers.service.spec.js @@ -5,6 +5,11 @@ const mockData = require('../../tests/test-helpers/mock-data') describe('Helper Service', function() { var fakeWindow = { + // Without the `angular` field our fake window will crush + // `angular-mocks@1.6.2` and higher! + angular: { + callbacks: {} + }, location: { href: '/' }, diff --git a/app/services/jwtInterceptor.service.spec.js b/app/services/jwtInterceptor.service.spec.js index 8715e1896..ec11b7461 100644 --- a/app/services/jwtInterceptor.service.spec.js +++ b/app/services/jwtInterceptor.service.spec.js @@ -33,6 +33,11 @@ describe('JWT Interceptor Service', function() { }) }, fakeWindow = { + // Without the `angular` field our fake window will crush + // `angular-mocks@1.6.2` and higher! + angular: { + callbacks: {} + }, location: '' } diff --git a/package.json b/package.json index 5e5663811..ca19358b7 100644 --- a/package.json +++ b/package.json @@ -8,7 +8,7 @@ "test": "karma start --tc --test" }, "devDependencies": { - "angular-mocks": "^1.4.9", + "angular-mocks": "^1.6.2", "appirio-tech-webpack-config": "^0.3.8", "babel-polyfill": "^6.7.2", "bardjs": "^0.1.8",