jest-createspyobj
TypeScript icon, indicating that this package has built-in type declarations

2.0.0 • Public • Published

jest-createspyobj

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

USAGE

import { createSpyObj } from 'jest-createspyobj';

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

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

API

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

Package Sidebar

Install

npm i jest-createspyobj

Weekly Downloads

15,068

Version

2.0.0

License

MIT

Unpacked Size

9.86 kB

Total Files

6

Last publish

Collaborators

  • iamthes