Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

jest-createspyobj

unlight43.4kMIT2.0.0TypeScript support: included

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

jest, create-spy, spy-class, spy-object

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

changelog

2.0.0 (2020-12-05)

Bug Fixes

BREAKING CHANGES

  • Node LTS is required

1.2.2 (2018-09-03)

Fix

1.2.1 (2018-08-18)

Fix

1.2.0 (2018-06-19)

Update

1.1.0 (2018-04-19)

Update

1.0.1 (2018-04-03)

Fix

1.0.0 (2018-04-03)

New

Upgrade