UNPKG

ts-prime

Version:

A utility library for JavaScript and Typescript.

11 lines (9 loc) 215 B
import { debounce } from './debounce'; test('debounce', () => { const mock = jest.fn(); const s = debounce(mock, 10); for (let i = 0; i < 100; i++) { s(); } expect(mock).toHaveBeenCalledTimes(1); });