Skip to content

Commit 5a0d195

Browse files
committed
chore(animationFrameScheduler): minor test code improvement
Make test assert order more clear
1 parent 0ed6b94 commit 5a0d195

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

spec/schedulers/AnimationFrameScheduler-spec.ts

+9-3
Original file line numberDiff line numberDiff line change
@@ -165,19 +165,25 @@ describe('Scheduler.animationFrame', () => {
165165
let runDelayed = false;
166166
let runFirst = false;
167167
animationFrame.schedule(() => {
168-
animationFrame.schedule(() => { runFirst = true; });
169168
animationFrame.schedule(() => {
170169
if (!runDelayed) {
171170
done(new Error('Delayed action did not run'));
172-
} else if (!runFirst) {
171+
return;
172+
}
173+
runFirst = true;
174+
});
175+
animationFrame.schedule(() => {
176+
if (!runFirst) {
173177
done(new Error('First action did not run'));
174178
} else {
175179
done();
176180
}
177181
});
178182

179183
// This action will execute before the next frame because the delay is less than the one of the frame
180-
animationFrame.schedule(() => { runDelayed = true; }, 1);
184+
animationFrame.schedule(() => {
185+
runDelayed = true;
186+
}, 1);
181187
});
182188
});
183189

0 commit comments

Comments
 (0)