diff options
Diffstat (limited to 'tests/unit/serve_test.ts')
-rw-r--r-- | tests/unit/serve_test.ts | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/tests/unit/serve_test.ts b/tests/unit/serve_test.ts index 4a19d8df2..c1e217a11 100644 --- a/tests/unit/serve_test.ts +++ b/tests/unit/serve_test.ts @@ -792,8 +792,8 @@ Deno.test( async function httpServerDefaultOnListenCallback() { const ac = new AbortController(); - const consoleLog = console.log; - console.log = (msg) => { + const consoleError = console.error; + console.error = (msg) => { try { const match = msg.match( /Listening on http:\/\/(localhost|0\.0\.0\.0):(\d+)\//, @@ -818,7 +818,7 @@ Deno.test( await server.finished; } finally { - console.log = consoleLog; + console.error = consoleError; } }, ); @@ -875,8 +875,8 @@ Deno.test({ permissions: { net: true } }, async function ipv6Hostname() { const ac = new AbortController(); let url = ""; - const consoleLog = console.log; - console.log = (msg) => { + const consoleError = console.error; + console.error = (msg) => { try { const match = msg.match(/Listening on (http:\/\/(.*?):(\d+)\/)/); assert(!!match, `Didn't match ${msg}`); @@ -897,7 +897,7 @@ Deno.test({ permissions: { net: true } }, async function ipv6Hostname() { assert(new URL(url), `Not a valid URL "${url}"`); await server.shutdown(); } finally { - console.log = consoleLog; + console.error = consoleError; } }); |