I have an API that returns JSON with datetime fields.
{
...
"createdAt": "2021-11-01T12:08:05.334Z",
"createdUser": "dev",
"updatedAt": "2021-11-01T12:10:59.000Z",
"updatedUser": "dev",
"versionFlag": 3
}
I need to write a test that the above datetime fields are in correct format. (Just correct format that represents a correct timestamp. no need to verify the value)
expect(markerTypeInfo.createdAt).to.be.a('Date') is failing because the input is in string type. How this is done properly?