@@ -101,6 +101,7 @@ export class ConfigSet {
101
101
readonly isolatedModules : boolean
102
102
readonly cwd : string
103
103
readonly rootDir : string
104
+ cacheSuffix ! : string
104
105
tsCacheDir : string | undefined
105
106
parsedTsConfig ! : ParsedCommandLine | Record < string , any >
106
107
resolvedTransformers : TsJestAstTransformer = {
@@ -349,20 +350,30 @@ export class ConfigSet {
349
350
* @internal
350
351
*/
351
352
private _resolveTsCacheDir ( ) : void {
353
+ this . cacheSuffix = sha1 (
354
+ stringify ( {
355
+ version : this . compilerModule . version ,
356
+ digest : this . tsJestDigest ,
357
+ babelConfig : this . babelConfig ,
358
+ compilerModule : this . compilerModule ,
359
+ tsconfig : {
360
+ options : this . parsedTsConfig . options ,
361
+ raw : this . parsedTsConfig . raw ,
362
+ } ,
363
+ isolatedModules : this . isolatedModules ,
364
+ diagnostics : this . _diagnostics ,
365
+ transformers : this . resolvedTransformers ,
366
+ } ) ,
367
+ )
352
368
if ( ! this . _jestCfg . cache ) {
353
369
this . logger . debug ( 'file caching disabled' )
354
370
} else {
355
- const cacheSuffix = sha1 (
356
- stringify ( {
357
- version : this . compilerModule . version ,
358
- digest : this . tsJestDigest ,
359
- compilerModule : this . compilerModule ,
360
- compilerOptions : this . parsedTsConfig . options ,
361
- isolatedModules : this . isolatedModules ,
362
- diagnostics : this . _diagnostics ,
363
- } ) ,
371
+ const res = join (
372
+ this . _jestCfg . cacheDirectory ,
373
+ 'ts-jest' ,
374
+ this . cacheSuffix . substr ( 0 , 2 ) ,
375
+ this . cacheSuffix . substr ( 2 ) ,
364
376
)
365
- const res = join ( this . _jestCfg . cacheDirectory , 'ts-jest' , cacheSuffix . substr ( 0 , 2 ) , cacheSuffix . substr ( 2 ) )
366
377
367
378
this . logger . debug ( { cacheDirectory : res } , 'will use file caching' )
368
379
0 commit comments