<commit_before><p align="center">
  <h3 align="center">jestdouble</h3>
  <p align="center">jestdouble is an alternative mock/spy for jest.<p>
  <p align="center">
    <a href="https://www.npmjs.com/package/jestdouble">
      <img src="https://img.shields.io/npm/v/jestdouble.svg" alt="npm version">
    </a>
    <a href="https://travis-ci.org/Moeriki/jestdouble">
      <img src="https://travis-ci.org/Moeriki/jestdouble.svg?branch=master" alt="Build Status"></img>
    </a>
    <a href="https://coveralls.io/github/Moeriki/jestdouble?branch=master">
      <img src="https://coveralls.io/repos/github/Moeriki/jestdouble/badge.svg?branch=master" alt="Coverage Status"></img>
    </a>
    <a href="https://snyk.io/test/github/moeriki/jestdouble">
      <img src="https://snyk.io/test/github/moeriki/jestdouble/badge.svg" alt="Known Vulnerabilities"></img>
    </a>
  </p>
</p>

*   [Installation](#installation)
*   [Why](#why)
*   [Quick start](#quick-start)
*   [Mocking results](#mocking-results)
*   [Conditionally mocking results](#conditionally-mocking-results)
*   [Verifying calls](#verifying-calls)
*   [Conditionally verifying calls](#conditionally-verifying-calls)
*   [Matching](#matching)
*   [Notes](#notes)
*   [Credit](#credit)

<a name="installation"></a>
## Installation

```
$ npm install --save-dev jestdouble
```

<a name="why"></a>
## Why

I wanted a mock/spy function that:

*   could conditionally [mock results](#conditionally-mocking-results) / [verify calls](#conditionally-verifying-calls)
*   had [smart value matching](#matching) enabled by default
*   was [compatible with jasmine assertions](#verifying-calls)
*   had an awesome API

<a name="quick-start"></a>
## Quick start

```javascript
const jd = require('jestdouble');<commit_msg>Add note on `expect` usage<commit_after><p align="center">
  <h3 align="center">jestdouble</h3>
  <p align="center">jestdouble is an alternative mock/spy for jest.<p>
  <p align="center">
    <a href="https://www.npmjs.com/package/jestdouble">
      <img src="https://img.shields.io/npm/v/jestdouble.svg" alt="npm version">
    </a>
    <a href="https://travis-ci.org/Moeriki/jestdouble">
      <img src="https://travis-ci.org/Moeriki/jestdouble.svg?branch=master" alt="Build Status"></img>
    </a>
    <a href="https://coveralls.io/github/Moeriki/jestdouble?branch=master">
      <img src="https://coveralls.io/repos/github/Moeriki/jestdouble/badge.svg?branch=master" alt="Coverage Status"></img>
    </a>
    <a href="https://snyk.io/test/github/moeriki/jestdouble">
      <img src="https://snyk.io/test/github/moeriki/jestdouble/badge.svg" alt="Known Vulnerabilities"></img>
    </a>
  </p>
</p>

*   [Installation](#installation)
*   [Why](#why)
*   [Quick start](#quick-start)
*   [Mocking results](#mocking-results)
*   [Conditionally mocking results](#conditionally-mocking-results)
*   [Verifying calls](#verifying-calls)
*   [Conditionally verifying calls](#conditionally-verifying-calls)
*   [Matching](#matching)
*   [Notes](#notes)
*   [Credit](#credit)

<a name="installation"></a>
## Installation

```
$ npm install --save-dev jestdouble
```

<a name="why"></a>
## Why

I wanted a mock/spy function that:

*   could conditionally [mock results](#conditionally-mocking-results) / [verify calls](#conditionally-verifying-calls)
*   had [smart value matching](#matching) enabled by default
*   was [compatible with jasmine assertions](#verifying-calls)
*   had an awesome API

<a name="quick-start"></a>
## Quick start

All references to `expect` are [jest.expect](https://facebook.github.io/jest/docs/expect.html#content).

```javascript
const jd = require('jestdouble');
{'fraction_non_alphanumeric': 0.1863013698630137, 'fraction_numerical': 0.001095890410958904, 'mean_word_length': 4.531818181818182, 'pattern_counts': {'":': 0, '<': 61, '<?xml version=': 0, '>': 61, 'https://': 17, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3031648', 'n_tokens_mistral': 1319, 'n_tokens_neox': 1234, 'n_words': 223}