Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: set default port to 3020 #37

Merged
merged 5 commits into from
Jan 31, 2025
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
fix: remove two dev server
  • Loading branch information
krushnarout committed Jan 23, 2025
commit 25c30e9913ecae18c0d343efa4f824aeff8e9f51
27 changes: 7 additions & 20 deletions tests/test3-dev-server-port.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,33 +35,20 @@ test("test3 dev server port handling", async () => {
},
})

const server = net.createServer().listen(3020)

const availablePort1 = await getAvailablePort(3020)
const devServer1 = new DevServer({
port: availablePort1,
componentFilePath: `${tempDirPath}/snippet.tsx`,
})
await devServer1.start()

const availablePort2 = await getAvailablePort(availablePort1 + 1)
const devServer2 = new DevServer({
port: availablePort2,
const availablePort = await getAvailablePort(3020)
const devServer = new DevServer({
port: availablePort,
componentFilePath: `${tempDirPath}/snippet.tsx`,
})
await devServer2.start()
await devServer.start()

const is3020Available = await isPortAvailable(3020)
expect(is3020Available).toBe(false)
const isPort1Available = await isPortAvailable(availablePort1)
expect(isPort1Available).toBe(false)

const isPort2Available = await isPortAvailable(availablePort2)
expect(isPort2Available).toBe(false)
const isPortAvailableForDevServer = await isPortAvailable(availablePort)
expect(isPortAvailableForDevServer).toBe(false)

afterEach(async () => {
await devServer1.stop()
await devServer2.stop()
server.close()
await devServer.stop()
})
})
Loading