jest-createspyobj

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

Downloads in past

Stats

StarsIssuesVersionUpdatedCreatedSize
jest-createspyobj
712.0.03 years ago6 years agoMinified + gzip package size for jest-createspyobj in KB

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