Files
30-seconds-of-code/test/throttle.test.js
Angelos Chalaris 39ff17ae2a Additional tests
2018-11-10 13:04:37 +02:00

12 lines
343 B
JavaScript

const expect = require('expect');
const {throttle} = require('./_30s.js');
test('throttle is a Function', () => {
expect(throttle).toBeInstanceOf(Function);
});
test('throttle returns a function', () => {
let throttled = throttle(x => x, 100000);
expect(throttled).toBeInstanceOf(Function);
expect(throttled(10)).toBe(undefined);
});