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[]