artes 1.1.15 → 1.1.16
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
|
@@ -237,16 +237,11 @@ When(
|
|
|
237
237
|
When(
|
|
238
238
|
"User expects that response body should match {string} schema",
|
|
239
239
|
async function (expectedSchema) {
|
|
240
|
-
const schema = selector(expectedSchema);
|
|
241
|
-
|
|
242
|
-
const
|
|
243
|
-
|
|
244
|
-
const
|
|
245
|
-
|
|
246
|
-
const responseBody = context.response?.responseBody;
|
|
247
|
-
|
|
248
|
-
const valid = validate(responseBody);
|
|
249
|
-
|
|
250
|
-
expect(valid).toBe(true);
|
|
240
|
+
const schema = await selector(expectedSchema);
|
|
241
|
+
const ajv = await new Ajv();
|
|
242
|
+
const validate = await ajv.compile(schema);
|
|
243
|
+
const responseBody = await context.response["Response Body"];
|
|
244
|
+
const valid = await validate(responseBody);
|
|
245
|
+
await expect(valid).toBe(true);
|
|
251
246
|
},
|
|
252
247
|
);
|