From 6c107344aab4f665f80bb200fd19427a7cf2b330 Mon Sep 17 00:00:00 2001 From: Thomas Heartman Date: Wed, 14 Sep 2022 12:33:39 +0200 Subject: [PATCH] #1391: flag validation errors and warnings as test failures --- src/test/e2e/api/openapi/openapi.e2e.test.ts | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/test/e2e/api/openapi/openapi.e2e.test.ts b/src/test/e2e/api/openapi/openapi.e2e.test.ts index fa0e45bcec..3e87149c5e 100644 --- a/src/test/e2e/api/openapi/openapi.e2e.test.ts +++ b/src/test/e2e/api/openapi/openapi.e2e.test.ts @@ -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); });