From 1ffd9c8bbc4eda9fe9376fdba138ba27767532f1 Mon Sep 17 00:00:00 2001 From: Chang Cao Date: Thu, 15 Sep 2022 19:56:05 +0800 Subject: [PATCH] fix: mark `ts-jest` as optional in `ConfigGlobals` --- src/types.ts | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/src/types.ts b/src/types.ts index 14ae3948b9..b99d434f6f 100644 --- a/src/types.ts +++ b/src/types.ts @@ -17,7 +17,7 @@ declare module '@jest/types' { */ // eslint-disable-next-line // @ts-ignore - 'ts-jest': TsJestGlobalOptions + 'ts-jest'?: TsJestGlobalOptions } } } @@ -184,7 +184,7 @@ export interface TransformOptionsTsJest extends TransformOptions { * @deprecated use `JestConfigWithTsJest` instead */ export interface GlobalConfigTsJest extends Config.ConfigGlobals { - 'ts-jest': TsJestGlobalOptions + 'ts-jest'?: TsJestGlobalOptions } /** * @deprecated use `JestConfigWithTsJest` instead @@ -193,16 +193,13 @@ export interface InitialOptionsTsJest extends Config.InitialOptions { globals?: GlobalConfigTsJest } type TsJestTransformerOptions = TsJestGlobalOptions -export interface JestConfigWithTsJest extends Partial> { - transform: { +export interface JestConfigWithTsJest extends Omit { + transform?: { [regex: string]: 'ts-jest' | ['ts-jest', TsJestTransformerOptions] | string | [string, Record] } } export type StringMap = Map -/** - * @internal - */ export interface DepGraphInfo { fileContent: string resolvedModuleNames: string[]