oav/test/sample.ts

25 строки
914 B
TypeScript
Исходник Постоянная ссылка Обычный вид История

// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
2018-06-04 23:06:00 +03:00
// Sample standalone script to call live validator.
2020-11-24 06:07:36 +03:00
import { LiveValidator } from "../lib/liveValidation/liveValidator";
2018-05-30 01:38:27 +03:00
2018-06-04 23:06:00 +03:00
const options = {
directory: `${__dirname}/../../test/liveValidation/swaggers/`,
swaggerPathsPattern: [
2020-11-24 06:07:36 +03:00
"specification\\mediaservices\\resource-manager\\Microsoft.Media\\2018-07-01\\*.json",
],
git: {
2020-11-24 06:07:36 +03:00
shouldClone: false,
},
};
const validator = new LiveValidator(options);
2018-06-30 01:30:59 +03:00
2020-11-24 06:07:36 +03:00
// eslint-disable-next-line @typescript-eslint/no-floating-promises
validator.initialize().then(() => {
2020-11-24 06:07:36 +03:00
const reqRes = require(`${__dirname}/../../test/liveValidation/payloads/oneOfMissing_input.json`);
const result = validator.validateLiveRequestResponse(reqRes);
// tslint:disable-next-line:no-console
2020-11-24 06:07:36 +03:00
console.log(`${result}`);
});