We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent d663494 commit 37ca725Copy full SHA for 37ca725
tests/debounce-test.ts
@@ -538,3 +538,26 @@ QUnit.test('onError', function(assert) {
538
539
bb.debounce(null, () => { throw new Error('QUnit.test error'); }, 20);
540
});
541
+
542
+QUnit.test('debounce within a debounce can be canceled GH#183', function(assert) {
543
+ assert.expect(3);
544
545
+ let done = assert.async();
546
+ let bb = new Backburner(['zomg']);
547
548
+ let steps: string[] = [];
549
+ let foo = () => {
550
+ assert.ok(true, 'foo called');
551
+ return bb.debounce(bar, 10);
552
+ };
553
554
+ let bar = () => {
555
+ assert.ok(true, 'bar called');
556
+ let timer = foo();
557
+ bb.cancel(timer);
558
559
+ setTimeout(done, 10);
560
561
562
+ foo();
563
+});
0 commit comments