summaryrefslogtreecommitdiff
path: root/tests/unit/serve_test.ts
diff options
context:
space:
mode:
Diffstat (limited to 'tests/unit/serve_test.ts')
-rw-r--r--tests/unit/serve_test.ts6
1 files changed, 4 insertions, 2 deletions
diff --git a/tests/unit/serve_test.ts b/tests/unit/serve_test.ts
index 4a7d53e1b..450ab6d93 100644
--- a/tests/unit/serve_test.ts
+++ b/tests/unit/serve_test.ts
@@ -748,9 +748,11 @@ Deno.test(
const consoleLog = console.log;
console.log = (msg) => {
try {
- const match = msg.match(/Listening on http:\/\/localhost:(\d+)\//);
+ const match = msg.match(
+ /Listening on http:\/\/(localhost|0\.0\.0\.0):(\d+)\//,
+ );
assert(!!match, `Didn't match ${msg}`);
- const port = +match[1];
+ const port = +match[2];
assert(port > 0 && port < 65536);
} finally {
ac.abort();