From f511ea4e12f9c3ed3b0d050f9a5377e134188b72 Mon Sep 17 00:00:00 2001 From: Benny Joo Date: Tue, 24 Oct 2023 11:46:57 +0100 Subject: [PATCH] remove unnecessary code and configure correctly --- setupVitest.ts | 12 ------------ vitest.workspace.ts | 9 ++++++++- 2 files changed, 8 insertions(+), 13 deletions(-) diff --git a/setupVitest.ts b/setupVitest.ts index 3b671f5b97..18104fa24c 100644 --- a/setupVitest.ts +++ b/setupVitest.ts @@ -1,4 +1,3 @@ -import { JSDOM } from "jsdom"; import { vi } from "vitest"; import createFetchMock from "vitest-fetch-mock"; @@ -6,14 +5,3 @@ const fetchMocker = createFetchMock(vi); // sets globalThis.fetch and globalThis.fetchMock to our mocked version fetchMocker.enableMocks(); - -const jsdom = new JSDOM("", { - url: "http://localhost", -}); - -global.window = jsdom.window; -global.document = jsdom.window.document; -global.navigator = { - ...global.navigator, - userAgent: "node.js", -}; diff --git a/vitest.workspace.ts b/vitest.workspace.ts index 587aeb8cbf..977fa4a23d 100644 --- a/vitest.workspace.ts +++ b/vitest.workspace.ts @@ -16,7 +16,7 @@ const workspaces = packagedEmbedTestsOnly test: { include: ["packages/**/*.{test,spec}.{ts,js}", "apps/**/*.{test,spec}.{ts,js}"], // TODO: Ignore the api until tests are fixed - exclude: ["**/node_modules/**/*", "packages/embeds/**/*"], + exclude: ["**/node_modules/**/*", "packages/embeds/**/*", "packages/lib/hooks/**/*"], setupFiles: ["setupVitest.ts"], }, }, @@ -46,6 +46,13 @@ const workspaces = packagedEmbedTestsOnly setupFiles: ["packages/app-store/test-setup.ts"], }, }, + { + test: { + name: "@calcom/packages/lib/hooks", + include: ["packages/lib/hooks/**/*.{test,spec}.{ts,js}"], + environment: "jsdom", + }, + }, ]; export default defineWorkspace(workspaces);