mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-04-21 20:15:17 +00:00
Tests: Don't attempt to create echo server if internals is not exposed
This commit is contained in:
parent
7f8ba951cb
commit
a24718cc49
Notes:
github-actions[bot]
2025-01-03 10:48:12 +00:00
Author: https://github.com/tcl3 Commit: https://github.com/LadybirdBrowser/ladybird/commit/a24718cc491 Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/3089
1 changed files with 9 additions and 1 deletions
|
@ -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…
Add table
Reference in a new issue