We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 4ce4566 commit 9423ae4Copy full SHA for 9423ae4
tests/app/timer/timer-tests.ts
@@ -113,16 +113,18 @@ export function test_setTimeout_callbackShouldBeCleared() {
113
export function test_setInterval_callbackCalledDuringPeriod(done) {
114
let counter = 0;
115
const expected = 4;
116
+ const timeLimit = 300;
117
118
const start = TKUnit.time();
119
// >> timer-set-expression
120
const id = timer.setInterval(() => {
121
// >> (hide)
122
counter++;
- if (counter === 4) {
123
+ if (counter === expected) {
124
const end = TKUnit.time();
125
timer.clearInterval(id);
- 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);
128
}
129
// << (hide)
130
}, 50);
0 commit comments