Stub generator for tests
$ npm install test-stub
import stub from 'test-stub';
const fn = stub(
(a, b) => a + b,
(a, b) => a * b
);
console.log(fn(1, 2)); // 3
console.log(fn(3, 4)); // 12
Creates a functions that calls fns[0]
on the first, fns[1]
on the second call (and so on).
MIT