mercredi 30 mars 2016

Pass date testing angular unit tests

I have a ternary that seems to be returning a passing test, but it is failing.

$scope.depart = (typeof serverShortDate !== 'undefined') ? new Date(serverShortDate) : new Date();



AssertionError: expected Wed, 30 Mar 2016 21:26:12 GMT to deeply equal Wed, 30 Mar 2016 21:26:12 GMT

Here is my simple spec

    expect(scope.depart).to.deep.equal(new Date());

All that I can imagine is that somewhere is a difference. The error message shows the same values.

Aucun commentaire:

Enregistrer un commentaire