@@ -173,7 +173,7 @@ test('it throws if timeout is exceeded', async () => {
173
173
174
174
const promise = waitForElement ( callback , {
175
175
container,
176
- timeout : 300 ,
176
+ timeout : 70 ,
177
177
mutationObserverOptions : { attributes : true } ,
178
178
} ) . then ( successHandler , errorHandler )
179
179
@@ -182,14 +182,14 @@ test('it throws if timeout is exceeded', async () => {
182
182
expect ( errorHandler ) . toHaveBeenCalledTimes ( 0 )
183
183
184
184
container . setAttribute ( 'data-test-attribute' , 'something changed once' )
185
- await skipSomeTimeForMutationObserver ( 200 )
185
+ await skipSomeTimeForMutationObserver ( 50 )
186
186
187
187
expect ( callback ) . toHaveBeenCalledTimes ( 2 )
188
188
expect ( successHandler ) . toHaveBeenCalledTimes ( 0 )
189
189
expect ( errorHandler ) . toHaveBeenCalledTimes ( 0 )
190
190
191
191
container . setAttribute ( 'data-test-attribute' , 'something changed twice' )
192
- await skipSomeTimeForMutationObserver ( 150 )
192
+ await skipSomeTimeForMutationObserver ( 50 )
193
193
194
194
expect ( callback ) . toHaveBeenCalledTimes ( 3 )
195
195
expect ( successHandler ) . toHaveBeenCalledTimes ( 0 )
@@ -209,7 +209,7 @@ test('it throws the same error that the callback has thrown if timeout is exceed
209
209
210
210
const promise = waitForElement ( callback , {
211
211
container,
212
- timeout : 300 ,
212
+ timeout : 70 ,
213
213
mutationObserverOptions : { attributes : true } ,
214
214
} ) . then ( successHandler , errorHandler )
215
215
@@ -218,14 +218,14 @@ test('it throws the same error that the callback has thrown if timeout is exceed
218
218
expect ( errorHandler ) . toHaveBeenCalledTimes ( 0 )
219
219
220
220
container . setAttribute ( 'data-test-attribute' , 'something changed once' )
221
- await skipSomeTimeForMutationObserver ( 200 )
221
+ await skipSomeTimeForMutationObserver ( 50 )
222
222
223
223
expect ( callback ) . toHaveBeenCalledTimes ( 2 )
224
224
expect ( successHandler ) . toHaveBeenCalledTimes ( 0 )
225
225
expect ( errorHandler ) . toHaveBeenCalledTimes ( 0 )
226
226
227
227
container . setAttribute ( 'data-test-attribute' , 'something changed twice' )
228
- await skipSomeTimeForMutationObserver ( 150 )
228
+ await skipSomeTimeForMutationObserver ( 50 )
229
229
230
230
expect ( callback ) . toHaveBeenCalledTimes ( 3 )
231
231
expect ( successHandler ) . toHaveBeenCalledTimes ( 0 )
@@ -249,7 +249,7 @@ test('it returns immediately if the callback returns the value before any mutati
249
249
250
250
const promise = waitForElement ( callback , {
251
251
container,
252
- timeout : 300 ,
252
+ timeout : 70 ,
253
253
mutationObserverOptions : { attributes : true } ,
254
254
} ) . then ( successHandler , errorHandler )
255
255
@@ -265,7 +265,7 @@ test('it returns immediately if the callback returns the value before any mutati
265
265
expect ( errorHandler ) . toHaveBeenCalledTimes ( 0 )
266
266
267
267
container . setAttribute ( 'data-test-attribute' , 'something changed once' )
268
- await skipSomeTimeForMutationObserver ( 200 )
268
+ await skipSomeTimeForMutationObserver ( 50 )
269
269
270
270
// No more calls are expected.
271
271
expect ( callback ) . toHaveBeenCalledTimes ( 1 )
0 commit comments