Skip to content

Commit c87a86e

Browse files
committed
Unmock banner to ensure it doesn't print when using --json flag
1 parent 230626c commit c87a86e

File tree

2 files changed

+10
-0
lines changed

2 files changed

+10
-0
lines changed

packages/wrangler/src/__tests__/cloudchamber/curl.test.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import { http, HttpResponse } from "msw";
22
import patchConsole from "patch-console";
3+
import { vi } from "vitest";
34
import { collectCLIOutput } from "../helpers/collect-cli-output";
45
import { mockAccountId, mockApiToken } from "../helpers/mock-account-id";
56
import { MOCK_DEPLOYMENTS_COMPLEX } from "../helpers/mock-cloudchamber";
@@ -10,6 +11,10 @@ import { runInTempDir } from "../helpers/run-in-tmp";
1011
import { runWrangler } from "../helpers/run-wrangler";
1112
import { mockAccount, setWranglerConfig } from "./utils";
1213

14+
// we want to include the banner to make sure it doesn't show up in the output
15+
// when using --json
16+
vi.unmock("../wrangler-banner");
17+
1318
describe("cloudchamber curl", () => {
1419
const std = collectCLIOutput();
1520
const helpStd = mockConsoleMethods();

packages/wrangler/src/__tests__/cloudchamber/images.test.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import { http, HttpResponse } from "msw";
22
import patchConsole from "patch-console";
3+
import { vi } from "vitest";
34
import { mockAccountId, mockApiToken } from "../helpers/mock-account-id";
45
import { mockConsoleMethods } from "../helpers/mock-console";
56
import { useMockIsTTY } from "../helpers/mock-istty";
@@ -8,6 +9,10 @@ import { runInTempDir } from "../helpers/run-in-tmp";
89
import { runWrangler } from "../helpers/run-wrangler";
910
import { mockAccount, setWranglerConfig } from "./utils";
1011

12+
// we want to include the banner to make sure it doesn't show up in the output
13+
// when using --json
14+
vi.unmock("../wrangler-banner");
15+
1116
describe("cloudchamber image", () => {
1217
const std = mockConsoleMethods();
1318
const { setIsTTY } = useMockIsTTY();

0 commit comments

Comments
 (0)