chai-datetime icon indicating copy to clipboard operation
chai-datetime copied to clipboard

If the actual value is not a date at all the lib should throw an assertion error

Open diamondarts opened this issue 8 years ago • 0 comments

Something like

expect("foobar").to.equalDate(new Date());

causes the code to throw

TypeError: date.toDateString is not a function

However, it would be preferable if the lib throws an assertion error, which makes the problem more clear.

AssertionError: expected non-date object (foobar) to equal Thu June 29 2016

This issue is different from #26 where the author apparently wants the lib to accept strings as actual values.

diamondarts avatar Jun 29 '16 08:06 diamondarts