jest-createspyobj
v2.0.0
Published
Helper function to create spy object for `jest`, same as `jasmine.createSpyObj`
Downloads
89,935
Maintainers
Readme
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>;