tj / should.js

BDD style assertions for node.js -- test framework agnostic
MIT License
2.75k stars 195 forks source link

How to assert date having ISO 8601 format #227

Open shashikumarraja opened 8 years ago

shashikumarraja commented 8 years ago

I need to assert the date field body of my api response which is in ISO 8601 format i.e 2016-11-09T16:04:27.964Z Is there a way I can do so?

dsuare1 commented 7 years ago

+1 - Any resolution on this?

shashikumarraja commented 7 years ago

@dsuare1 I am unable to find any way to do so till now.

dsuare1 commented 7 years ago

@shashikumarraja Neither could I when trying yesterday; I tried to use the Assertion#Date type assertion, but never got the syntax correct. I ended up taking the mock, which was in GMT format, and converting it to UTC and comparing that with my expected output.