Skip to content

Commit

Permalink
closes vercel#55050, add reserved port validation
Browse files Browse the repository at this point in the history
  • Loading branch information
olingern committed Sep 12, 2023
1 parent d7c03ad commit b6ab60c
Showing 1 changed file with 13 additions and 7 deletions.
20 changes: 13 additions & 7 deletions test/integration/cli/test/index.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -211,9 +211,12 @@ describe('CLI Usage', () => {

test('should not start on a port out of range', async () => {
const invalidPort = '300001'
const { stderr } = await runNextCommand(['start', '--port', invalidPort], {
stderr: true,
})
const { stderr } = await runNextCommand(
['start', '--port', invalidPort],
{
stderr: true,
}
)

expect(stderr).toContain(
`options.port should be >= 0 and < 65536. Received type number (${invalidPort}).`
Expand All @@ -222,10 +225,13 @@ describe('CLI Usage', () => {

test('should not start on a reserved port', async () => {
const reservedPort = '4045'
const { stderr } = await runNextCommand(['start', '--port', reservedPort], {
stderr: true,
})
console.log(stderr)
const { stderr } = await runNextCommand(
['start', '--port', reservedPort],
{
stderr: true,
}
)

expect(stderr).toContain(
`Bad port: '${reservedPort}' is reserved for npp`
)
Expand Down

0 comments on commit b6ab60c

Please sign in to comment.