Unverified Commit 869aab39 authored by Diptesh Choudhuri's avatar Diptesh Choudhuri Committed by GitHub

fix standalone wrong url being logged (#44887)

Co-authored-by: 's avatarJJ Kasper <jj@jjsweb.site>
parent 969cca87
...@@ -1789,7 +1789,7 @@ server.listen(currentPort, (err) => { ...@@ -1789,7 +1789,7 @@ server.listen(currentPort, (err) => {
console.log( console.log(
'Listening on port', 'Listening on port',
currentPort, currentPort,
'url: http://localhost:' + currentPort 'url: http://' + hostname + ':' + currentPort
) )
})` })`
) )
......
...@@ -15,6 +15,7 @@ describe('minimal-mode-response-cache', () => { ...@@ -15,6 +15,7 @@ describe('minimal-mode-response-cache', () => {
let next: NextInstance let next: NextInstance
let server let server
let appPort let appPort
let output = ''
beforeAll(async () => { beforeAll(async () => {
// test build against environment with next support // test build against environment with next support
...@@ -59,11 +60,18 @@ describe('minimal-mode-response-cache', () => { ...@@ -59,11 +60,18 @@ describe('minimal-mode-response-cache', () => {
/Listening on/, /Listening on/,
{ {
...process.env, ...process.env,
HOSTNAME: '',
PORT: appPort, PORT: appPort,
}, },
undefined, undefined,
{ {
cwd: next.testDir, cwd: next.testDir,
onStdout(msg) {
output += msg
},
onStderr(msg) {
output += msg
},
} }
) )
}) })
...@@ -72,6 +80,11 @@ describe('minimal-mode-response-cache', () => { ...@@ -72,6 +80,11 @@ describe('minimal-mode-response-cache', () => {
if (server) await killApp(server) if (server) await killApp(server)
}) })
it('should have correct "Listening on" log', async () => {
expect(output).toContain(`Listening on port`)
expect(output).toContain(`url: http://localhost:${appPort}`)
})
it('should have correct responses', async () => { it('should have correct responses', async () => {
const html = await renderViaHTTP(appPort, '/') const html = await renderViaHTTP(appPort, '/')
expect(html.length).toBeTruthy() expect(html.length).toBeTruthy()
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment