File tree Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Original file line number Diff line number Diff line change @@ -113,16 +113,18 @@ export function test_setTimeout_callbackShouldBeCleared() {
113
113
export function test_setInterval_callbackCalledDuringPeriod ( done ) {
114
114
let counter = 0 ;
115
115
const expected = 4 ;
116
+ const timeLimit = 300 ;
116
117
117
118
const start = TKUnit . time ( ) ;
118
119
// >> timer-set-expression
119
120
const id = timer . setInterval ( ( ) => {
120
121
// >> (hide)
121
122
counter ++ ;
122
- if ( counter === 4 ) {
123
+ if ( counter === expected ) {
123
124
const end = TKUnit . time ( ) ;
124
125
timer . clearInterval ( id ) ;
125
- done ( end - start > 250 ? new Error ( 'setInterval too slow.' ) : null ) ;
126
+ const time = end - start ;
127
+ done ( time > timeLimit ? new Error ( `setInterval too slow. Actual time: ${ time } timelimit: ${ timeLimit } ` ) : null ) ;
126
128
}
127
129
// << (hide)
128
130
} , 50 ) ;
You can’t perform that action at this time.
0 commit comments