From 73385346fc1bbf575daba637494fcc28b4f3b340 Mon Sep 17 00:00:00 2001 From: Gijs de Man Date: Fri, 8 Dec 2023 15:16:23 +0100 Subject: [PATCH] Update tests --- package.json | 2 +- .../src/markdown/createSchema.test.ts | 8 +++++--- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/package.json b/package.json index 3173e6e68..601782e06 100644 --- a/package.json +++ b/package.json @@ -30,7 +30,7 @@ "cy:open": "cypress open", "format": "prettier . --check --ignore-unknown --ignore-path .prettierignore", "lint": "eslint . --ignore-path .gitignore --ext .ts,.tsx,.js", - "test": "jest", + "test": "NODE_OPTIONS=--experimental-vm-modules jest", "test:cypress:dev": "start-server-and-test watch:demo http://localhost:3000 cy:open", "test:cypress": "start-server-and-test serve http://localhost:3000 cy:run", "release:changelog": "scripts/changelog.ts", diff --git a/packages/docusaurus-plugin-openapi-docs/src/markdown/createSchema.test.ts b/packages/docusaurus-plugin-openapi-docs/src/markdown/createSchema.test.ts index 66f5d07c0..682dd378e 100644 --- a/packages/docusaurus-plugin-openapi-docs/src/markdown/createSchema.test.ts +++ b/packages/docusaurus-plugin-openapi-docs/src/markdown/createSchema.test.ts @@ -11,7 +11,7 @@ import { SchemaObject } from "../openapi/types"; import { createNodes } from "./createSchema"; describe("createNodes", () => { - it("should create readable MODs for oneOf primitive properties", () => { + it("should create readable MODs for oneOf primitive properties", async () => { const schema: SchemaObject = { type: "object", properties: { @@ -48,8 +48,10 @@ describe("createNodes", () => { } }; expect( - createNodes(schema, "request").map((md: any) => - prettier.format(md, { parser: "babel" }) + await Promise.all( + createNodes(schema, "request").map( + async (md: any) => await prettier.format(md, { parser: "babel" }) + ) ) ).toMatchSnapshot(); });