# jest-matcher-called-on

> Jest Custom Matcher Asserts the Context the Spy is Called On

Latest version **1.0.1** (published 2018-04-23) · MIT license · 0 weekly downloads

## Install

```sh
npm install jest-matcher-called-on
pnpm add jest-matcher-called-on
yarn add jest-matcher-called-on
bun add jest-matcher-called-on
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.1 |
| Published | 2018-04-23 |
| First published | 2018-04-22 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 2 |
| Unpacked size | 7.8 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Maintainers | josephchapman |
| Keywords | Jest, Custom, Matcher, Spy, toHaveBeenCalledOn, calledOn, Test, Unit, Context |

## Links

- npm: https://www.npmjs.com/package/jest-matcher-called-on
- Repository: https://github.com/joechapan/jest-matcher-called-on
- Homepage: https://github.com/joechapan/jest-matcher-called-on#readme
- Issues: https://github.com/joechapan/jest-matcher-called-on/issues
- npm.io page: https://npm.io/package/jest-matcher-called-on

## Dependencies (2)

- [babel-core](https://npm.io/package/babel-core.md) ^6.26.0
- [babel-jest](https://npm.io/package/babel-jest.md) ^22.4.3

## Alternatives

- [duck](https://npm.io/package/duck.md) — 4.2M weekly downloads
- [ava](https://npm.io/package/ava.md) — 560.2K weekly downloads
- [storybook-addon-module-mock](https://npm.io/package/storybook-addon-module-mock.md) — 71.7K weekly downloads
- [@ethereum-waffle/mock-contract](https://npm.io/package/@ethereum-waffle/mock-contract.md) — 40.0K weekly downloads
- [aws-elasticsearch-connector](https://npm.io/package/aws-elasticsearch-connector.md) — 37.4K weekly downloads

## Recent versions

- 1.0.1 (latest) — 2018-04-23
- 1.0.0 — 2018-04-22

## README

# Jest Matcher calledOn

A Jest custom matcher that asserts a Spy or Stub was called on a given context, like `sinon.calledOn`

## Usage
```bash
$ npm i jest-matcher-called-on
```

In `<rootDir>/jest/customMatchers.js` add the following
```js
import calledOn from 'jest-matcher-called-on';

expect.extend(calledOn);
```

Then in `./package.json` add
```json
"jest": {
  "setupTestFrameworkScriptFile": "<rootDir>/jest/customMatchers.js"
}
```

And use in your tests like
```js
expect(spy).calledOn(obj);
```

## Scripts
```bash
$ npm t
```

```bash
$ npm run lint
```

Contributions and comments welcome.

---
_Source: https://npm.io/package/jest-matcher-called-on · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
