This commit is contained in:
Ilya Kantor 2019-10-29 06:32:44 +03:00
parent 4159a65ea2
commit d5195b5d59

View file

@ -44,4 +44,20 @@ describe("throttle(f, 1000)", function() {
this.clock.restore();
});
});
});
describe('throttle', () => {
it('runs a forwarded call once', done => {
let log = '';
const f = str => log += str;
const f10 = throttle(f, 10);
f10('once');
setTimeout(() => {
assert.equal(log, 'once');
done();
}, 20);
});
});