Skip to content

Commit

Permalink
test: ensure that mocks are setup in isolation on each test
Browse files Browse the repository at this point in the history
  • Loading branch information
petebacondarwin committed Mar 5, 2024
1 parent 93e83b1 commit 27471d6
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions packages/create-cloudflare/src/__tests__/templates.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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";
Expand All @@ -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;
Expand Down

0 comments on commit 27471d6

Please sign in to comment.