Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/unlight/jest-createspyobj

Helper function to create spy object for `jest`, same as `jasmine.createSpyObj`
https://github.com/unlight/jest-createspyobj

createspyobj jasmine jest spy

Last synced: about 2 months ago
JSON representation

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

Awesome Lists containing this project

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;
function createSpyObj(ref: Constructor, methods?: string[]): jest.Mocked;
```