Skip to content

Commit

Permalink
fix: mark ts-jest as optional in ConfigGlobals (#3816)
Browse files Browse the repository at this point in the history
Fixes #3815
  • Loading branch information
Chang Cao committed Sep 17, 2022
1 parent 21c5536 commit cbb88bb
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
3 changes: 3 additions & 0 deletions e2e/config-typing/jest.config.ts
Expand Up @@ -9,6 +9,9 @@ const jestCfg: JestConfigWithTsJest = {
},
],
},
globals: {
aaa: true,
},
}

export default jestCfg
11 changes: 4 additions & 7 deletions src/types.ts
Expand Up @@ -17,7 +17,7 @@ declare module '@jest/types' {
*/
// eslint-disable-next-line
// @ts-ignore
'ts-jest': TsJestGlobalOptions
'ts-jest'?: TsJestGlobalOptions
}
}
}
Expand Down Expand Up @@ -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
Expand All @@ -193,16 +193,13 @@ export interface InitialOptionsTsJest extends Config.InitialOptions {
globals?: GlobalConfigTsJest
}
type TsJestTransformerOptions = TsJestGlobalOptions
export interface JestConfigWithTsJest extends Partial<Omit<Config.ProjectConfig, 'transform'>> {
transform: {
export interface JestConfigWithTsJest extends Omit<Config.InitialOptions, 'transform'> {
transform?: {
[regex: string]: 'ts-jest' | ['ts-jest', TsJestTransformerOptions] | string | [string, Record<string, unknown>]
}
}

export type StringMap = Map<string, string>
/**
* @internal
*/
export interface DepGraphInfo {
fileContent: string
resolvedModuleNames: string[]
Expand Down

0 comments on commit cbb88bb

Please sign in to comment.