Skip to content

Commit 6f04d94

Browse files
committed
test(e2e): add runtime error overlay test for initial load
1 parent 45bb778 commit 6f04d94

File tree

2 files changed

+36
-49
lines changed

2 files changed

+36
-49
lines changed

test/e2e/overlay-initial-runtime-error.test.js

Lines changed: 0 additions & 49 deletions
This file was deleted.

test/e2e/overlay.test.js

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1976,4 +1976,40 @@ describe("overlay", () => {
19761976
await server.stop();
19771977
}
19781978
});
1979+
1980+
it("should keep overlay visible for runtime error on initial load", async () => {
1981+
const compiler = webpack(config);
1982+
1983+
const server = new Server(
1984+
{
1985+
port,
1986+
},
1987+
compiler,
1988+
);
1989+
1990+
await server.start();
1991+
1992+
const { page, browser } = await runBrowser();
1993+
1994+
try {
1995+
await page.goto(`http://localhost:${port}/`, {
1996+
waitUntil: "networkidle0",
1997+
});
1998+
1999+
await page.addScriptTag({
2000+
content: `
2001+
throw new Error("Initial runtime error");
2002+
`,
2003+
});
2004+
2005+
await delay(1000);
2006+
2007+
const overlayHandle = await page.$("#webpack-dev-server-client-overlay");
2008+
2009+
expect(overlayHandle).not.toBeNull();
2010+
} finally {
2011+
await browser.close();
2012+
await server.stop();
2013+
}
2014+
});
19792015
});

0 commit comments

Comments
 (0)