Commit 1508009 1 parent ae9245f commit 1508009 Copy full SHA for 1508009
File tree 1 file changed +5
-2
lines changed
packages/jest-dev-server/src
1 file changed +5
-2
lines changed Original file line number Diff line number Diff line change @@ -56,7 +56,7 @@ export type Config = {
56
56
* Action to take if the port is already used.
57
57
* @default "ask"
58
58
*/
59
- usedPortAction ?: "ask" | "error" | "ignore" ;
59
+ usedPortAction ?: "ask" | "error" | "ignore" | "kill" ;
60
60
/**
61
61
* Options to pass to [`wait-on`](https://www.npmjs.com/package/wait-on).
62
62
* @see https://www.npmjs.com/package/wait-on#options
@@ -170,7 +170,10 @@ const checkIsPortBusy = async (config: Config): Promise<boolean> => {
170
170
171
171
type UsedPortHandler = ( port : number ) => boolean | Promise < boolean > ;
172
172
173
- const usedPortHandlers : Record < string , UsedPortHandler > = {
173
+ const usedPortHandlers : Record <
174
+ NonNullable < Config [ "usedPortAction" ] > ,
175
+ UsedPortHandler
176
+ > = {
174
177
error : ( port ) => {
175
178
throw new JestDevServerError ( `Port ${ port } is in use` , {
176
179
code : ERROR_PORT_USED ,
You can’t perform that action at this time.
0 commit comments