Fix jestOpenAPI call.
This commit is contained in:
parent
8123a04a8e
commit
2c1b10e4a1
|
@ -72,6 +72,10 @@ function writeFile(output: any, filename: string) {
|
|||
return path
|
||||
}
|
||||
|
||||
export function spec() {
|
||||
return swaggerJsdoc({ ...opts, format: ".json" })
|
||||
}
|
||||
|
||||
export function run() {
|
||||
writeFile(swaggerJsdoc({ ...opts, format: ".json" }), "openapi.json")
|
||||
return writeFile(swaggerJsdoc({ ...opts, format: ".yaml" }), "openapi.yaml")
|
||||
|
|
|
@ -1,12 +1,11 @@
|
|||
import jestOpenAPI from "jest-openapi"
|
||||
import { run as generateSchema } from "../../../../specs/generate"
|
||||
import { spec } from "../../../../specs/generate"
|
||||
import TestConfiguration from "../TestConfiguration"
|
||||
import request, { SuperTest, Test, Response } from "supertest"
|
||||
import { ReadStream } from "fs"
|
||||
import { getServer } from "../../../app"
|
||||
|
||||
const yamlPath = generateSchema()
|
||||
jestOpenAPI(yamlPath!)
|
||||
jestOpenAPI(spec() as any)
|
||||
|
||||
type Headers = Record<string, string | string[] | undefined>
|
||||
type Method = "get" | "post" | "put" | "patch" | "delete"
|
||||
|
|
Loading…
Reference in New Issue