test-stub

0.0.1 • Public • Published

test-stub

Stub generator for tests

install

install the package with npm:

$ npm install test-stub

usage

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

api

stub(...fns)

Creates a functions that calls fns[0] on the first, fns[1] on the second call (and so on).

license

MIT

Package Sidebar

Install

npm i test-stub

Weekly Downloads

0

Version

0.0.1

License

MIT

Last publish

Collaborators

  • lennon