Skip to content

Commit 7df3721

Browse files
brandonaarongregberge
authored andcommitted
fix: do not attempt to start the server when usedPortAction is ignore and isPortTaken is true (#219)
1 parent f3bb941 commit 7df3721

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

packages/jest-dev-server/src/global.js

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -174,9 +174,16 @@ async function setupJestServer(providedConfig, index) {
174174
if (isPortTaken) {
175175
await usedPortHandler()
176176
}
177-
}
178177

179-
runServer(config, index)
178+
if (config.usedPortAction === 'ignore' && isPortTaken) {
179+
console.log('')
180+
console.log('Port is already taken. Assuming server is already running.')
181+
} else {
182+
runServer(config, index)
183+
}
184+
} else {
185+
runServer(config, index)
186+
}
180187

181188
if (config.port) {
182189
const { launchTimeout } = config

0 commit comments

Comments
 (0)