From dbad9ddeefb911dc9e88bf113152d8c442ada8d4 Mon Sep 17 00:00:00 2001 From: Sebastian Martinez Date: Fri, 30 Jun 2023 07:24:30 +0200 Subject: [PATCH] Remove hack for `happy-dom` The update to happy-dom 8.0 did remove the need to do the assignment hack in `setupVitest` source: https://github.com/vitest-dev/vitest/issues/2305#issuecomment-1396387954 Signed-off-by: Sebastian Martinez --- tests/support/setupVitest.ts | 9 --------- vite.config.ts | 1 - 2 files changed, 10 deletions(-) delete mode 100644 tests/support/setupVitest.ts diff --git a/tests/support/setupVitest.ts b/tests/support/setupVitest.ts deleted file mode 100644 index 2841eded1..000000000 --- a/tests/support/setupVitest.ts +++ /dev/null @@ -1,9 +0,0 @@ -// Found in https://github.com/belgattitude/nextjs-monorepo-example/pull/2913 -// Hack for vitest 0.25.2 / happy-dom. Keep till those issues are fixed -// - https://github.com/vitest-dev/vitest/issues/2305#issuecomment-1311420462 -// - https://github.com/capricorn86/happy-dom/issues/569 - -import { URL } from "node:url"; -//@ts-expect-error The two types don't match, but for this hack we have to -//overwrite the given URL by happy-dom with the URL class passed by Node -globalThis.URL = URL; diff --git a/vite.config.ts b/vite.config.ts index 3730ad6db..cbf2cf90b 100644 --- a/vite.config.ts +++ b/vite.config.ts @@ -8,7 +8,6 @@ import { svelte } from "@sveltejs/vite-plugin-svelte"; export default defineConfig({ test: { - setupFiles: "./tests/support/setupVitest", environment: "happy-dom", include: ["tests/unit/**/*.test.ts"], reporters: "verbose",