diff --git a/Tests/LibWeb/Text/input/include.js b/Tests/LibWeb/Text/input/include.js index 2034a4b743c..1cd3d97e6cd 100644 --- a/Tests/LibWeb/Text/input/include.js +++ b/Tests/LibWeb/Text/input/include.js @@ -121,7 +121,15 @@ class HTTPTestServer { } } -const __httpTestServer = new HTTPTestServer(`http://localhost:${internals.getEchoServerPort()}`); +const __httpTestServer = (function () { + if (globalThis.internals && globalThis.internals.getEchoServerPort) + return new HTTPTestServer(`http://localhost:${internals.getEchoServerPort()}`); + + return null; +})(); + function httpTestServer() { + if (!__httpTestServer) + throw new Error("window.internals must be exposed to use HTTPTestServer"); return __httpTestServer; }