oav/test/errorInfoTests.ts

29 строки
827 B
TypeScript
Исходник Обычный вид История

// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
2020-11-24 06:07:36 +03:00
import * as assert from "assert";
2020-11-24 06:07:36 +03:00
import { validateExamples } from "../lib/validate";
describe("error info", () => {
it("error info should contain url to file", async () => {
try {
const result = await validateExamples(
"./test/modelValidation/swaggers/specification/errorInfo/apimusers.json",
undefined,
{
2020-11-24 06:07:36 +03:00
consoleLogLevel: "off",
}
2020-11-24 06:07:36 +03:00
);
assert.strictEqual(result.length, 2);
const r = result[0] as any;
assert.strictEqual(
r.schemaUrl,
"./test/modelValidation/swaggers/specification/errorInfo/apimusers.json"
2020-11-24 06:07:36 +03:00
);
} catch (e) {
2020-11-24 06:07:36 +03:00
assert.fail(e);
}
2020-11-24 06:07:36 +03:00
});
});