# jest-createspyobj

> Helper function to create spy object for `jest`, same as `jasmine.createSpyObj`

Latest version **2.0.0** (published 2020-12-05) · MIT license · 0 weekly downloads

## Install

```sh
npm install jest-createspyobj
pnpm add jest-createspyobj
yarn add jest-createspyobj
bun add jest-createspyobj
```

## Health

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

Positive: has types; no vulnerabilities; high quality score.

Warnings: low downloads; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 2.0.0 |
| Published | 2020-12-05 |
| First published | 2018-04-03 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 9.6 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 8 |
| Author | 2020 |
| Maintainers | iamthes |
| Keywords | jest, create-spy, spy-class, spy-object |

## Links

- npm: https://www.npmjs.com/package/jest-createspyobj
- Repository: https://github.com/unlight/jest-createspyobj
- Homepage: https://github.com/unlight/jest-createspyobj#readme
- Issues: https://github.com/unlight/jest-createspyobj/issues
- npm.io page: https://npm.io/package/jest-createspyobj

## Alternatives

- [pagerjs](https://npm.io/package/pagerjs.md) — 60 weekly downloads
- [whistle.savefor-mock](https://npm.io/package/whistle.savefor-mock.md) — 4 weekly downloads
- [@wiremark/core](https://npm.io/package/@wiremark/core.md) — 0 weekly downloads
- [@shko.online/componentframework-mock](https://npm.io/package/@shko.online/componentframework-mock.md) — 0 weekly downloads
- [electron-mocks](https://npm.io/package/electron-mocks.md) — 0 weekly downloads

## Recent versions

- 2.0.0 (latest) — 2020-12-05
- 1.2.2 — 2018-09-03
- 1.2.1 — 2018-08-18
- 1.2.0 — 2018-06-19
- 1.1.0 — 2018-04-19
- 1.0.1 — 2018-04-03
- 1.0.0 — 2018-04-03

## README

# jest-createspyobj

Helper function to create spy object for `jest`, same as `jasmine.createSpyObj`

## USAGE

```ts
import { createSpyObj } from 'jest-createspyobj';

class Tape {
    play() {}
    pause() {}
}

const spy1 = createSpyObj('Tape', ['play', 'pause']);
const spy1 = createSpyObj(Tape);
```

## API

```ts
function createSpyObj(ref: string, methods: string[]): jest.Mocked<any>;
function createSpyObj<T>(ref: Constructor<T>, methods?: string[]): jest.Mocked<T>;
```

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