Mocha Tape Deck
Create, manage, and replay HTTP requests and responses for fast, deterministic tests.
Installation
Using npm
npm install --save-dev mocha-tape-deck
Using yarn
yarn add -D mocha-tape-deck
Quickstart
const TapeDeck = const express = const rp = const expect =
Usage
Wrap an existing test that makes HTTP requests in a TestTapeDeck
. For example:
ex:
becomes
const TapeDeck = // the method provided to describe must use the keyword 'function', DO NOT use a fat arrow function (() => ...)
Easy integration testing
Set the environment variable NO_CASSETTE_MOCKING
(e.g. NO_CASSETTE_MOCKING=true mocha ....
) to ignore all mocking code. This allows your unit/component tests to also be your integration tests!