With the Unmock runner
, you can run any test multiple times with different potential outcomes from the API.
This package holds the core functions for the Jest configuration of the runner
.
By default, the runner
is set to run your test 20 times.
The unmock-jest-runner
can be installed via NPM or Yarn:
npm install -D unmock-jest-runner
yarn add unmock-jest-runner
Once installed, the runner
can be imported as a default and used as a wrapper for your tests:
const runner = require("unmock-jest-runner").default;
test("my API always works as expected", runner(async () => {
const res = await myApiFunction();
// some expectations
}));
As of now, Jest is the only package available for the Unmock runner
.
However, we're currently building out support for Mocha and QUnit. You can follow the progress of those implementations in the corresponding issues.