Skip to content

unlight/jest-createspyobj

Repository files navigation

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

About

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

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Contributors 2

  •  
  •