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

Commit 274b9ce

Browse files
committed
fix date stringify expectations
1 parent bb8223c commit 274b9ce

File tree

3 files changed

+5
-3
lines changed

3 files changed

+5
-3
lines changed

test/ng/directive/ngBindSpec.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ describe('ngBind*', function() {
7878
$rootScope.bind = new Date(2014, 10, 10, 0, 0, 0);
7979
element = $compile('<div ng-bind="bind"></div>')($rootScope);
8080
$rootScope.$digest();
81-
expect(element.text()).toEqual('"2014-11-09T23:00:00.000Z"');
81+
expect(element.text()).toBe('"' + $rootScope.bind.toJSON() + '"');
8282
}));
8383

8484

test/ng/interpolateSpec.js

+2-1
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,8 @@ describe('$interpolate', function() {
5353

5454

5555
it('should NOT use toString on Date objects', inject(function($interpolate) {
56-
expect($interpolate('{{a}}')({ a: new Date(2014, 10, 10, 0, 0, 0) })).toEqual('"2014-11-09T23:00:00.000Z"');
56+
var date = new Date(2014, 10, 10);
57+
expect($interpolate('{{a}}')({ a: date })).toBe('"' + date.toJSON() + '"');
5758
}));
5859

5960

test/ngMessageFormat/messageFormatSpec.js

+2-1
Original file line numberDiff line numberDiff line change
@@ -329,7 +329,8 @@ describe('$$ngMessageFormat', function() {
329329

330330

331331
it('should NOT use toString on Date objects', inject(function($interpolate) {
332-
expect($interpolate('{{a}}')({ a: new Date(2014, 10, 10, 0, 0, 0) })).toEqual('"2014-11-09T23:00:00.000Z"');
332+
var date = new Date(2014, 10, 10);
333+
expect($interpolate('{{a}}')({ a: date })).toBe('"' + date.toJSON() + '"');
333334
}));
334335

335336

0 commit comments

Comments
 (0)