@@ -86,25 +86,8 @@ export class TsJestTransformer implements SyncTransformer {
86
86
this . _watchMode = ccs . watchMode
87
87
configSet = ccs . configSet
88
88
} else {
89
- if ( config . globals ?. [ 'ts-jest' ] ) {
90
- this . _logger . warn ( Deprecations . GlobalsTsJestConfigOption )
91
- }
92
- const jestGlobalsConfig = config . globals ?? { }
93
- const tsJestGlobalsConfig = jestGlobalsConfig [ 'ts-jest' ] ?? { }
94
- const migratedConfig = this . tsJestConfig
95
- ? {
96
- ...config ,
97
- globals : {
98
- ...jestGlobalsConfig ,
99
- 'ts-jest' : {
100
- ...tsJestGlobalsConfig ,
101
- ...this . tsJestConfig ,
102
- } ,
103
- } ,
104
- }
105
- : config
106
89
// try to look-it up by stringified version
107
- const serializedJestCfg = stringify ( migratedConfig )
90
+ const serializedJestCfg = stringify ( config )
108
91
const serializedCcs = TsJestTransformer . _cachedConfigSets . find (
109
92
( cs ) => cs . jestConfig . serialized === serializedJestCfg ,
110
93
)
@@ -122,6 +105,24 @@ export class TsJestTransformer implements SyncTransformer {
122
105
} else {
123
106
// create the new record in the index
124
107
this . _logger . info ( 'no matching config-set found, creating a new one' )
108
+
109
+ if ( config . globals ?. [ 'ts-jest' ] ) {
110
+ this . _logger . warn ( Deprecations . GlobalsTsJestConfigOption )
111
+ }
112
+ const jestGlobalsConfig = config . globals ?? { }
113
+ const tsJestGlobalsConfig = jestGlobalsConfig [ 'ts-jest' ] ?? { }
114
+ const migratedConfig = this . tsJestConfig
115
+ ? {
116
+ ...config ,
117
+ globals : {
118
+ ...jestGlobalsConfig ,
119
+ 'ts-jest' : {
120
+ ...tsJestGlobalsConfig ,
121
+ ...this . tsJestConfig ,
122
+ } ,
123
+ } ,
124
+ }
125
+ : config
125
126
configSet = this . _createConfigSet ( migratedConfig )
126
127
const jest = { ...migratedConfig }
127
128
// we need to remove some stuff from jest config
0 commit comments