Skip to content

Commit d5195b5

Browse files
committed
closes #1524 #716
1 parent 4159a65 commit d5195b5

File tree

1 file changed

+17
-1
lines changed
  • 1-js/06-advanced-functions/09-call-apply-decorators/04-throttle/_js.view

1 file changed

+17
-1
lines changed

1-js/06-advanced-functions/09-call-apply-decorators/04-throttle/_js.view/test.js

+17-1
Original file line numberDiff line numberDiff line change
@@ -44,4 +44,20 @@ describe("throttle(f, 1000)", function() {
4444
this.clock.restore();
4545
});
4646

47-
});
47+
});
48+
49+
describe('throttle', () => {
50+
51+
it('runs a forwarded call once', done => {
52+
let log = '';
53+
const f = str => log += str;
54+
const f10 = throttle(f, 10);
55+
f10('once');
56+
57+
setTimeout(() => {
58+
assert.equal(log, 'once');
59+
done();
60+
}, 20);
61+
});
62+
63+
});

0 commit comments

Comments
 (0)