I have an error when comparing "date" in a test in Angular. The test shows the error but in the log itself it is correct.
my test:
it('myTest', () => {
const today = new Date();
component.minDate = null;
component.maxDate = null;
spyOnProperty(component, 'isRange').and.returnValue(false);
component['setActivateDate'](null);
spyOn(component, <any>'verifyActivateDate').and.callThrough();
expect(component.activateDate).toEqual(today);
});
Log with "error"
Error: Expected Date(Wed Nov 17 2021 20:28:54 GMT+0000 (Coordinated Universal Time)) to equal Date(Wed Nov 17 2021 20:28:54 GMT+0000 (Coordinated Universal Time)).
at <Jasmine>