1
0
mirror of https://github.com/Unleash/unleash.git synced 2025-01-25 00:07:47 +01:00

#1391: flag validation errors and warnings as test failures

This commit is contained in:
Thomas Heartman 2022-09-14 12:33:39 +02:00
parent 40b7d2c6e4
commit 6c107344aa

View File

@ -54,7 +54,7 @@ test('the generated OpenAPI spec is valid', async () => {
return false;
}
const [openapi, error, warning] = await enforcer(body, {
const [, error, warning] = await enforcer(body, {
fullResult: true,
componentOptions: {
exceptionSkipCodes: [
@ -63,12 +63,12 @@ test('the generated OpenAPI spec is valid', async () => {
},
});
if (warning !== undefined) {
console.warn(warning);
}
if (error !== undefined) {
console.error(error);
}
if (warning !== undefined) {
// some of these _should_ probably be dealt with at some point.
console.warn(warning);
}
if (openapi !== undefined) console.log('Document is valid');
expect(warning ?? error).toBe(undefined);
});