Skip to content

Commit

Permalink
Update realworld testing to support string errors
Browse files Browse the repository at this point in the history
  • Loading branch information
seriousme committed Nov 12, 2023
1 parent 8febf93 commit 45973fb
Showing 1 changed file with 11 additions and 9 deletions.
20 changes: 11 additions & 9 deletions test/realworld/realworld.js
Original file line number Diff line number Diff line change
Expand Up @@ -206,15 +206,17 @@ async function doTest(apiList) {
results.valid++;
} else {
results.invalid++;
api.result.errors.map((item) => {
const [res, value] = getInstanceValue(spec, item.instancePath);
item.hasInstanceValue = res;
item.instanceValue = value;
item.gitHubUrl = `${api.gitHubUrl}#L${yamlLine(
spec,
item.instancePath,
)}`;
});
if (typeof api.result.errors === "object") {
api.result.errors.map((item) => {
const [res, value] = getInstanceValue(spec, item.instancePath);
item.hasInstanceValue = res;
item.instanceValue = value;
item.gitHubUrl = `${api.gitHubUrl}#L${yamlLine(
spec,
item.instancePath,
)}`;
});
}
if (failedMap.has(name)) {
const failedApiErrors = JSON.stringify(
failedMap.get(name).result.errors,
Expand Down

0 comments on commit 45973fb

Please sign in to comment.