Skip to content

Commit

Permalink
test: suppress console output
Browse files Browse the repository at this point in the history
  • Loading branch information
pi0 committed Jan 8, 2025
1 parent f8cb762 commit 49794a2
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions test/unit/runtime-config.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,14 +49,16 @@ describe("normalizeRuntimeConfig", () => {
});

it("should throw a warning when runtimeConfig is not serializable", () => {
const warnSpy = vi.spyOn(console, "warn");
const originalWarn = console.warn;
const spyWarn = (console.warn = vi.fn());
normalizeRuntimeConfig({
...nitroConfig,
runtimeConfig: {
...defaultRuntimeConfig,
brokenProperty: new Map(),
},
});
expect(warnSpy).toHaveBeenCalled();
console.warn = spyWarn;
expect(spyWarn).toHaveBeenCalledOnce();
});
});

0 comments on commit 49794a2

Please sign in to comment.