mirror of
https://github.com/Hopiu/angular.js.git
synced 2026-05-25 14:23:43 +00:00
fix(ngMock): ensure mocked window still provides window.location functionality
This commit is contained in:
parent
cec4ce28b9
commit
07ef1667db
1 changed files with 1 additions and 0 deletions
1
src/ngMock/angular-mocks.js
vendored
1
src/ngMock/angular-mocks.js
vendored
|
|
@ -640,6 +640,7 @@ angular.mock.createMockWindow = function() {
|
||||||
var mockWindow = {};
|
var mockWindow = {};
|
||||||
var setTimeoutQueue = [];
|
var setTimeoutQueue = [];
|
||||||
|
|
||||||
|
mockWindow.location = window.location;
|
||||||
mockWindow.document = window.document;
|
mockWindow.document = window.document;
|
||||||
mockWindow.getComputedStyle = angular.bind(window, window.getComputedStyle);
|
mockWindow.getComputedStyle = angular.bind(window, window.getComputedStyle);
|
||||||
mockWindow.scrollTo = angular.bind(window, window.scrollTo);
|
mockWindow.scrollTo = angular.bind(window, window.scrollTo);
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue