mirror of
https://github.com/zebrajr/ladybird.git
synced 2025-12-06 00:19:53 +01:00
Tests: Don't attempt to create echo server if internals is not exposed
This commit is contained in:
parent
7f8ba951cb
commit
a24718cc49
|
|
@ -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;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user