Hi,
I’m testing the format of this value “date” but unfortunately I received this.
Do you have any suggestions?
These are the elements:
Request POST Body
{
“key”: “value”,
“date”: “2017-07-21T17:32:28Z”,
“key”: “value”,
“key”: “value”,
“key”: “value”,
“key”: “value”
}
Test GET
const jsonData = pm.response.json();
pm.test(“date is in the correct format”, function () {
pm.expect(jsonData.date).to.match(/^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}Z$/);
});
GET response
“date is in the correct format | AssertionError: expected ‘2017-07-21 17:32:28+00:00’ to match /^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}Z$/”
Thanks!