2.0.0 • Published 3 years ago

jest-createspyobj v2.0.0

Weekly downloads
4,280
License
MIT
Repository
github
Last release
3 years ago

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>;