@@ -158,21 +158,29 @@ export default class TestScheduler {
158
158
} ;
159
159
160
160
const updateSnapshotState = async ( ) => {
161
- await Promise . all (
162
- Array . from ( contexts ) . map ( async context => {
163
- const status = snapshot . cleanup (
164
- context . hasteFS ,
165
- this . _globalConfig . updateSnapshot ,
166
- await snapshot . buildSnapshotResolver ( context . config ) ,
167
- context . config . testPathIgnorePatterns ,
168
- ) ;
169
-
170
- aggregatedResults . snapshot . filesRemoved += status . filesRemoved ;
171
- aggregatedResults . snapshot . filesRemovedList = (
172
- aggregatedResults . snapshot . filesRemovedList || [ ]
173
- ) . concat ( status . filesRemovedList ) ;
174
- } ) ,
161
+ const contextsWithSnapshotResolvers = await Promise . all (
162
+ Array . from ( contexts ) . map (
163
+ async context =>
164
+ [
165
+ context ,
166
+ await snapshot . buildSnapshotResolver ( context . config ) ,
167
+ ] as const ,
168
+ ) ,
175
169
) ;
170
+
171
+ contextsWithSnapshotResolvers . forEach ( ( [ context , snapshotResolver ] ) => {
172
+ const status = snapshot . cleanup (
173
+ context . hasteFS ,
174
+ this . _globalConfig . updateSnapshot ,
175
+ snapshotResolver ,
176
+ context . config . testPathIgnorePatterns ,
177
+ ) ;
178
+
179
+ aggregatedResults . snapshot . filesRemoved += status . filesRemoved ;
180
+ aggregatedResults . snapshot . filesRemovedList = (
181
+ aggregatedResults . snapshot . filesRemovedList || [ ]
182
+ ) . concat ( status . filesRemovedList ) ;
183
+ } ) ;
176
184
const updateAll = this . _globalConfig . updateSnapshot === 'all' ;
177
185
aggregatedResults . snapshot . didUpdate = updateAll ;
178
186
aggregatedResults . snapshot . failure = ! ! (
0 commit comments