diff --git a/packages/jest-config/src/getMaxWorkers.ts b/packages/jest-config/src/getMaxWorkers.ts index b96024477d6b..bd1adf1cecc5 100644 --- a/packages/jest-config/src/getMaxWorkers.ts +++ b/packages/jest-config/src/getMaxWorkers.ts @@ -15,7 +15,7 @@ export default function getMaxWorkers( return 1; } else if (argv.maxWorkers) { // TODO: How to type this properly? Should probably use `coerce` from `yargs` - const maxWorkers = (argv.maxWorkers as unknown) as number | string; + const maxWorkers = argv.maxWorkers; const parsed = parseInt(maxWorkers as string, 10); if ( diff --git a/packages/jest-types/src/Config.ts b/packages/jest-types/src/Config.ts index 5016143d0618..b5a479c884d5 100644 --- a/packages/jest-types/src/Config.ts +++ b/packages/jest-types/src/Config.ts @@ -452,7 +452,7 @@ export type Argv = Arguments< json: boolean; lastCommit: boolean; logHeapUsage: boolean; - maxWorkers: number; + maxWorkers: number | string; moduleDirectories: Array; moduleFileExtensions: Array; moduleNameMapper: string;