ffetched

1.0.0 • Public • Published

ffetched

A wrapper on farfetched to make you tests more succinct.

import mockFetch from 'ffetched';
import test from 'tape';
 
test('#fetch', t => {
  const unmockFetch = mockFetch('/some-uri', {
    data: 'back'
  });
 
  fetch('/some-uri').then(data => {
    t.deepEquals(data, {
      data: 'back'
    });
 
    unmockFetch();
    t.end();
  });
});

License MIT

With <3 by UXtemple.

Package Sidebar

Install

npm i ffetched

Weekly Downloads

0

Version

1.0.0

License

MIT

Last publish

Collaborators

  • dariocravero