8000 fix: mark `ts-jest` as optional in `ConfigGlobals` (#3816) · kulshekhar/ts-jest@cbb88bb · GitHub
[go: up one dir, main page]

Skip to content

Commit cbb88bb

Browse files
author
Chang Cao
authored
fix: mark ts-jest as optional in ConfigGlobals (#3816)
Fixes #3815
1 parent 21c5536 commit cbb88bb

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

e2e/config-typing/jest.config.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,9 @@ const jestCfg: JestConfigWithTsJest = {
99
},
1010
],
1111
},
12+
globals: {
13+
aaa: true,
14+
},
1215
}
1316

1417
export default jestCfg

src/types.ts

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ declare module '@jest/types' {
1717
*/
1818
// eslint-disable-next-line
1919
// @ts-ignore
20-
'ts-jest': TsJestGlobalOptions
20+
'ts-jest'?: TsJestGlobalOptions
2121
}
2222
}
2323
}
@@ -184,7 +184,7 @@ export interface TransformOptionsTsJest extends TransformOptions {
184184
* @deprecated use `JestConfigWithTsJest` instead
185185
*/
186186
export interface GlobalConfigTsJest extends Config.ConfigGlobals {
187-
'ts-jest': TsJestGlobalOptions
187+
'ts-jest'?: TsJestGlobalOptions
188188
}
189189
/**
190190
* @deprecated use `JestConfigWithTsJest` instead
@@ -193,16 +193,13 @@ export interface InitialOptionsTsJest extends Config.InitialOptions {
193193
globals?: GlobalConfigTsJest
194194
}
195195
type TsJestTransformerOptions = TsJestGlobalOptions
196-
export interface JestConfigWithTsJest extends Partial<Omit<Config.ProjectConfig, 'transform'>> {
197-
transform: {
196+
export interface JestConfigWithTsJest extends Omit<Config.InitialOptions, 'transform'> {
197+
transform?: {
198198
[regex: string]: 'ts-jest' | ['ts-jest', TsJestTransformerOptions] | string | [string, Record<string, unknown>]
199199
}
200200
}
201201

202202
export type StringMap = Map<string, string>
203-
/**
204-
* @internal
205-
*/
206203
export interface DepGraphInfo {
207204
fileContent: string
208205
resolvedModuleNames: string[]

0 commit comments

Comments
 (0)
0