Skip to content

Commit a24718c

Browse files
tcl3awesomekling
authored andcommitted
Tests: Don't attempt to create echo server if internals is not exposed
1 parent 7f8ba95 commit a24718c

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

Tests/LibWeb/Text/input/include.js

+9-1
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,15 @@ class HTTPTestServer {
121121
}
122122
}
123123

124-
const __httpTestServer = new HTTPTestServer(`http://localhost:${internals.getEchoServerPort()}`);
124+
const __httpTestServer = (function () {
125+
if (globalThis.internals && globalThis.internals.getEchoServerPort)
126+
return new HTTPTestServer(`http://localhost:${internals.getEchoServerPort()}`);
127+
128+
return null;
129+
})();
130+
125131
function httpTestServer() {
132+
if (!__httpTestServer)
133+
throw new Error("window.internals must be exposed to use HTTPTestServer");
126134
return __httpTestServer;
127135
}

0 commit comments

Comments
 (0)