Test that nothing is scheduled once the queue is empty
When the final item in the queue is processed, no additional callbacks should be scheduled to run.
Showing
1 changed file
with
3 additions
and
0 deletions
... | @@ -48,6 +48,9 @@ | ... | @@ -48,6 +48,9 @@ |
48 | 48 | ||
49 | callbacks.shift()(); | 49 | callbacks.shift()(); |
50 | strictEqual(1, callbacks.length, 'the next task is scheduled'); | 50 | strictEqual(1, callbacks.length, 'the next task is scheduled'); |
51 | |||
52 | callbacks.shift()(); | ||
53 | strictEqual(1, callbacks.length, 'nothing is scheduled on an empty queue'); | ||
51 | }); | 54 | }); |
52 | 55 | ||
53 | test('can be emptied at any time', function() { | 56 | test('can be emptied at any time', function() { | ... | ... |
-
Please register or sign in to post a comment