From e8db136f7a23cc9c63c8c223fe898dc731e6e193 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` --- e2e/config-typing/jest.config.ts | 3 +++ src/types.ts | 11 ++++------- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/e2e/config-typing/jest.config.ts b/e2e/config-typing/jest.config.ts index 832d5ffe4e..c58409f7ee 100644 --- a/e2e/config-typing/jest.config.ts +++ b/e2e/config-typing/jest.config.ts @@ -9,6 +9,9 @@ const jestCfg: JestConfigWithTsJest = { }, ], }, + globals: { + aaa: true, + }, } export default jestCfg 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[]