From 18ba1a21a9eb0e67c42f409d55d12ef4181f136d Mon Sep 17 00:00:00 2001 From: melancholiai Date: Wed, 21 Sep 2022 10:12:02 +0300 Subject: [PATCH] fix: test case for app with spec was wrong --- tests/OpenapiViewerMiddleware.spec.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/OpenapiViewerMiddleware.spec.ts b/tests/OpenapiViewerMiddleware.spec.ts index 3cf64bb..4ad5186 100644 --- a/tests/OpenapiViewerMiddleware.spec.ts +++ b/tests/OpenapiViewerMiddleware.spec.ts @@ -4,7 +4,7 @@ import { load } from 'js-yaml'; import { Application } from 'express'; import { StatusCodes } from 'http-status-codes'; import * as supertest from 'supertest'; - +import { JsonObject } from 'swagger-ui-express'; import { OpenapiRouterConfig, OpenapiViewerRouter } from '../src/index'; const openapiSpec = `openapi: 3.0.1 @@ -162,7 +162,7 @@ describe('openapiViewerRouter', function () { // initialize express app using spec config const configUsingSpec: OpenapiRouterConfig = { - filePathOrSpec: openapiSpec, + filePathOrSpec: load(openapiSpec) as JsonObject, rawPath: '/api', uiPath: '/api/ui', };