We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 0f1c6c7 commit 376b5d1Copy full SHA for 376b5d1
1 file changed
features/support/api.ts
@@ -166,9 +166,12 @@ export class ModelSteps extends BaseModelStep {
166
@then(/the response should have a property ([a-zA-Z]*) with value (.*)/)
167
public checkResponseProperty(propName: string, propValue: string) {
168
const value = this.apiResponse.data[propName];
169
- const formattedValue =
170
- value instanceof Date ? value.toISOString() : value.toString();
171
- assert.equal(formattedValue, propValue);
+ if (value instanceof Date) {
+ // JS/TS does not differentiate date/date-time. Need to construct prop date and compare.
+ assert.equal(value.toISOString(), new Date(propValue).toISOString());
172
+ } else {
173
+ assert.equal(value.toString(), propValue);
174
+ }
175
}
176
177
@then(/the response should be an array/)
0 commit comments