Skip to content
Source
Sign inSign up
pingdotgg/t3code

test(web): fix flaky startup and Tailwind tests #9558

Mergedt3dotgg(GitHub profile, opens in a new tab)merged 1 commit intomain fromrefs/pull/9558/headmerged by t3dotgg(GitHub profile, opens in a new tab) View on GitHub

Showing 2 changed files with 21 additions and 15 deletions.

x
0 of 2 viewed, 2 left
4 additions and 3 deletionsapps/web/src/bootstrap.test.tsModified
View file
@@ -30,9 +30,6 @@
​
beforeEach(() => {
vi.resetModules();
- vi.doMock("./main", () => {
- throw new Error("@vitejs/plugin-react can't detect preamble. Something is wrong.");
- });
bootShell = new BootElement("div");
vi.stubGlobal("document", {
getElementById: () => bootShell,
@@ -51,12 +48,16 @@
});
​
afterEach(() => {
+ vi.doUnmock("./main");
vi.unstubAllGlobals();
vi.unstubAllEnvs();
vi.restoreAllMocks();
});
​
it("replaces the splash when an app import throws before main can run", async () => {
+ vi.doMock("./main", () => {
+ throw new Error("@vitejs/plugin-react can't detect preamble. Something is wrong.");
+ });
const reload = vi.fn();
vi.stubGlobal("window", { location: { reload } });
​