Skip to content

Commit 1508009

Browse files
authored
fix(jest-dev-server): fix config types (#573)
Fix #572
1 parent ae9245f commit 1508009

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

packages/jest-dev-server/src/index.ts

+5-2
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ export type Config = {
5656
* Action to take if the port is already used.
5757
* @default "ask"
5858
*/
59-
usedPortAction?: "ask" | "error" | "ignore";
59+
usedPortAction?: "ask" | "error" | "ignore" | "kill";
6060
/**
6161
* Options to pass to [`wait-on`](https://www.npmjs.com/package/wait-on).
6262
* @see https://www.npmjs.com/package/wait-on#options
@@ -170,7 +170,10 @@ const checkIsPortBusy = async (config: Config): Promise<boolean> => {
170170

171171
type UsedPortHandler = (port: number) => boolean | Promise<boolean>;
172172

173-
const usedPortHandlers: Record<string, UsedPortHandler> = {
173+
const usedPortHandlers: Record<
174+
NonNullable<Config["usedPortAction"]>,
175+
UsedPortHandler
176+
> = {
174177
error: (port) => {
175178
throw new JestDevServerError(`Port ${port} is in use`, {
176179
code: ERROR_PORT_USED,

0 commit comments

Comments
 (0)