@@ -101,6 +101,7 @@ export class ConfigSet {
101101 readonly isolatedModules : boolean
102102 readonly cwd : string
103103 readonly rootDir : string
104+ cacheSuffix ! : string
104105 tsCacheDir : string | undefined
105106 parsedTsConfig ! : ParsedCommandLine | Record < string , any >
106107 resolvedTransformers : TsJestAstTransformer = {
@@ -349,20 +350,30 @@ export class ConfigSet {
349350 * @internal
350351 */
351352 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+ )
352368 if ( ! this . _jestCfg . cache ) {
353369 this . logger . debug ( 'file caching disabled' )
354370 } 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 ) ,
364376 )
365- const res = join ( this . _jestCfg . cacheDirectory , 'ts-jest' , cacheSuffix . substr ( 0 , 2 ) , cacheSuffix . substr ( 2 ) )
366377
367378 this . logger . debug ( { cacheDirectory : res } , 'will use file caching' )
368379
0 commit comments