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);