From 27471d6b9ab7da1c9e0e900d780305d0900029cf Mon Sep 17 00:00:00 2001 From: Peter Bacon Darwin Date: Tue, 5 Mar 2024 10:31:02 +0000 Subject: [PATCH] test: ensure that mocks are setup in isolation on each test --- packages/create-cloudflare/src/__tests__/templates.test.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/create-cloudflare/src/__tests__/templates.test.ts b/packages/create-cloudflare/src/__tests__/templates.test.ts index 20f5f486c005..1d73ad31704c 100644 --- a/packages/create-cloudflare/src/__tests__/templates.test.ts +++ b/packages/create-cloudflare/src/__tests__/templates.test.ts @@ -5,7 +5,7 @@ import { readFile, writeFile, } from "helpers/files"; -import { beforeAll, beforeEach, describe, expect, test, vi } from "vitest"; +import { beforeEach, describe, expect, test, vi } from "vitest"; import { addWranglerToGitIgnore } from "../templates"; import type { PathLike } from "fs"; import type { C3Context } from "types"; @@ -23,7 +23,7 @@ describe("addWranglerToGitIgnore", () => { content: string | undefined; } = { file: undefined, content: undefined }; - beforeAll(() => { + beforeEach(() => { vi.mocked(writeFile).mockImplementation((file: string, content: string) => { writeFileResults.file = file; writeFileResults.content = content;