Skip to content
This repository has been archived by the owner on Sep 15, 2020. It is now read-only.

Latest commit

 

History

History
26 lines (17 loc) · 597 Bytes

readme.md

File metadata and controls

26 lines (17 loc) · 597 Bytes

promisethat

Build Status npm

Helper functions for quickly wrapping mock data in promises for unit tests.

usage

npm install promisethat --save-dev

e.g.:

import promiseThat from "promisethat";

// mock response that needs to be wrapped in promise
const data: { aProperty: "with a value" };

// stubbed api call
sinon.stub(anApiLibrary, "anApiCall")
     .returns(promiseThat.resolvesWith(data));