diff --git a/packages/jest-config/src/ValidConfig.ts b/packages/jest-config/src/ValidConfig.ts index aa5ec67c747d..97e22dc030da 100644 --- a/packages/jest-config/src/ValidConfig.ts +++ b/packages/jest-config/src/ValidConfig.ts @@ -14,7 +14,6 @@ const NODE_MODULES_REGEXP = replacePathSepForRegex(NODE_MODULES); const initialOptions: Config.InitialOptions = { automock: false, - // @ts-ignore TODO: type this properly bail: multipleValidOptions(false, 0), browser: false, cache: true, @@ -39,9 +38,8 @@ const initialOptions: Config.InitialOptions = { }, }, dependencyExtractor: '/dependencyExtractor.js', - // @ts-ignore TODO: type this properly displayName: multipleValidOptions('test-config', { - color: 'blue', + color: 'blue' as 'blue', name: 'test-config', }), errorOnDeprecated: false, diff --git a/packages/jest-validate/src/condition.ts b/packages/jest-validate/src/condition.ts index 0df9b8cf1219..c413e631d388 100644 --- a/packages/jest-validate/src/condition.ts +++ b/packages/jest-validate/src/condition.ts @@ -33,10 +33,10 @@ export function validationCondition(option: any, validOption: any): boolean { return getValues(validOption).some(e => validationConditionSingle(option, e)); } -// TODO: This should infer the types of its arguments, and return a union type of the types -// See https://github.com/Microsoft/TypeScript/issues/5453 -export function multipleValidOptions(...args: Array) { - const options = [...args]; +export function multipleValidOptions>( + ...args: T +): T[number] { + const options = [...args]; // @ts-ignore options[MULTIPLE_VALID_OPTIONS_SYMBOL] = true; return options;