-
Notifications
You must be signed in to change notification settings - Fork 27.4k
Unit tests fail on chrome #3033
Comments
As part of our effort to clean out old issues, this issue is being automatically closed since it has been inactivite for over two months. Please try the newest versions of Angular ( Thanks! |
@btford I have this issue on the latest master. I try get some var date = new Date(-14400000)
date.toString() // Thu Jan 01 1970 00:00:00 GMT+0400 (MSK)
d.toLocaleDateString() // 12/31/1969
d.toLocaleString() // 12/31/1969 11:00:00 PM Now the test |
I suggest to make same changes, that and in a getHous test, landed by 0c65f1a |
@btford I think the issue still exists on the latest master as of now. I've just encountered it when forking and testing the latest master.
|
Upon further investigation, I think it looks like a Webkit issue (both Chrome and Safari has it). In both Chrome and Safari:
My timezone is Singapore (GMT+8 - and we don't have DST here), so I'm not sure where In Firefox:
Firefox also gets my timezone wrong: GMT+7.30, but at least it's wrong consistently. Since tzDate make use of angular.js/src/ngMock/angular-mocks.js Lines 647 to 649 in 547871e
@wagnerfrancisco @just-boris if this is not the same issue you're facing, please let me know, I'll create a new issue for it. Thanks! Edit: I'm quite new to this community. The above looks like a bug in Firefox / Chrome / Safari, but I guess even though they are browsers bug, AngularJS is expected to workaround those - so it seems a fix is needed in tzDate rather than the test case. Any idea if this is the right direction to proceed? |
Hi, I just downloaded the angular.js, tried to run the unit tests and one test failed. In the angular-mockSpecs.js file there is the "should fake getLocalDateString method" test. The second expectation fails:
var t1 = new angular.mock.TzDate(0, 0);
expect(t1.toLocaleDateString()).toMatch('1970');
The result is:
"Expected '31/12/1969' to match '1970'".
The reason of the error is that chrome implementation of Date.toLocaleDateString considers the timezone (I'm using gmt-2 in Brazil). Instead of printing something like 01/01/1970 it prints 31/12/1969).
I tried to run the tests on Chrome 27.0.1453.116 m. All the tests run perfectly on Firefox.
Thanks.
The text was updated successfully, but these errors were encountered: