Skip to content
This repository was archived by the owner on Apr 12, 2024. It is now read-only.

chore(*): Upgrade to Jasmine 2.4 #14226

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions angularFiles.js
Original file line number Diff line number Diff line change
Expand Up @@ -205,6 +205,7 @@ var angularFiles = {
"karmaModules": [
'build/angular.js',
'@angularSrcModules',
'test/modules/no_bootstrap.js',
'src/ngScenario/browserTrigger.js',
'test/helpers/*.js',
'test/ngMessageFormat/*.js',
Expand Down
2 changes: 1 addition & 1 deletion docs/app/test/docsSpec.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ describe("DocsController", function() {

it("should update the Google Analytics with $location.path if currentPage is missing", inject(function($window, $location) {
$window._gaq = [];
spyOn($location, 'path').andReturn('x/y/z');
spyOn($location, 'path').and.returnValue('x/y/z');
$scope.$broadcast('$includeContentLoaded');
expect($window._gaq.pop()).toEqual(['_trackPageview', 'x/y/z']);
}));
Expand Down
14 changes: 7 additions & 7 deletions docs/app/test/errorsSpec.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ describe('errors', function() {
// Mock `ngSanitize` module
angular.
module('ngSanitize', []).
value('$sanitize', jasmine.createSpy('$sanitize').andCallFake(angular.identity));
value('$sanitize', jasmine.createSpy('$sanitize').and.callFake(angular.identity));

beforeEach(module('errors'));

Expand Down Expand Up @@ -103,12 +103,12 @@ describe('errors', function() {


it('should pass the final string through `$sanitize`', function() {
$sanitize.reset();
$sanitize.calls.reset();

var input = 'start https://foo/bar?baz#qux end';
var output = errorLinkFilter(input);

expect($sanitize.callCount).toBe(1);
expect($sanitize).toHaveBeenCalledTimes(1);
expect($sanitize).toHaveBeenCalledWith(output);
});
});
Expand All @@ -123,7 +123,7 @@ describe('errors', function() {
beforeEach(module(function($provide) {
$provide.decorator('errorLinkFilter', function() {
errorLinkFilter = jasmine.createSpy('errorLinkFilter');
errorLinkFilter.andCallFake(angular.identity);
errorLinkFilter.and.callFake(angular.identity);

return errorLinkFilter;
});
Expand All @@ -142,18 +142,18 @@ describe('errors', function() {


it('should interpolate the contents against `$location.search()`', function() {
spyOn($location, 'search').andReturn({p0: 'foo', p1: 'bar'});
spyOn($location, 'search').and.returnValue({p0: 'foo', p1: 'bar'});

var elem = $compile('<span error-display="foo = {0}, bar = {1}"></span>')($rootScope);
expect(elem.html()).toBe('foo = foo, bar = bar');
});


it('should pass the interpolated text through `errorLinkFilter`', function() {
$location.search = jasmine.createSpy('search').andReturn({p0: 'foo'});
$location.search = jasmine.createSpy('search').and.returnValue({p0: 'foo'});

var elem = $compile('<span error-display="foo = {0}"></span>')($rootScope);
expect(errorLinkFilter.callCount).toBe(1);
expect(errorLinkFilter).toHaveBeenCalledTimes(1);
expect(errorLinkFilter).toHaveBeenCalledWith('foo = foo', '_blank');
});

Expand Down
Loading