angularjs - Jasmine date expect always returning false -
I have a test written in the Jasmine Test runner:
this ("expected" 'Due date is 14 days from now ", function () {var dateNow = new date (); scope.dateOfService (dateNow); expected (scope date == New date (dateNow.setDate (dateNow.getDate () <14>) ToBeTruthy ();});
Although it always lies? Is there something that I'm doing wrong?
I also ran to debug ':
Hope (scope) fixed date. TB (New Date) (DateNow.setDate (DateNow.getDate (+ + 14)));
and this return:
Expected date (Sue 11 November 2014 08: 20:23 GMT + 0000 (GMT Standard Time)) To date (Tuesday 11 November 2014 08:20:23 GMT + 0000 (GMT Standard Time))
The main point was to make sure .toBe
instead of .toEqual
.
Comments
Post a Comment