(
{
jestConfig,
tsJestConfig,
parentConfig,
}: {
jestConfig?: Partial<Config.ProjectConfig>
tsJestConfig?: TsJestTransformerOptions
parentConfig?: TsJestTransformerOptions
} = {},
jestCacheFS: StringMap = new Map<string, string>(),
)
| 75 | |
| 76 | // not really unit-testing here, but it's hard to mock all those values :-D |
| 77 | export function makeCompiler( |
| 78 | { |
| 79 | jestConfig, |
| 80 | tsJestConfig, |
| 81 | parentConfig, |
| 82 | }: { |
| 83 | jestConfig?: Partial<Config.ProjectConfig> |
| 84 | tsJestConfig?: TsJestTransformerOptions |
| 85 | parentConfig?: TsJestTransformerOptions |
| 86 | } = {}, |
| 87 | jestCacheFS: StringMap = new Map<string, string>(), |
| 88 | ): TsCompiler { |
| 89 | tsJestConfig = { ...tsJestConfig } |
| 90 | tsJestConfig.diagnostics = { |
| 91 | // eslint-disable-next-line @typescript-eslint/no-explicit-any |
| 92 | ...(tsJestConfig.diagnostics as any), |
| 93 | pretty: false, |
| 94 | } |
| 95 | jestConfig = { |
| 96 | ...jestConfig, |
| 97 | extensionsToTreatAsEsm: jestConfig?.extensionsToTreatAsEsm ?? [], |
| 98 | testMatch: jestConfig?.testMatch ? [...jestConfig.testMatch, ...defaultTestMatch] : defaultTestMatch, |
| 99 | testRegex: jestConfig?.testRegex ? [...jestConfig.testRegex, ...defaultTestRegex] : defaultTestRegex, |
| 100 | } |
| 101 | const cs = createConfigSet({ jestConfig, tsJestConfig, parentConfig, resolve: null }) |
| 102 | |
| 103 | return new TsCompiler(cs, jestCacheFS) |
| 104 | } |
searching dependent graphs…