1.0.3 • Published 3 years ago
jest-class-mock v1.0.3
jest-class-mock
Mock any class
in a snap for your Jest tests !
Installation
pnpm i jest-class-mock
npm i jest-class-mock
yarn add jest-class-mock
Usage
import { createMock } from 'jest-class-mock'
class MyService {
constructor(private otherService: OtherService) {}
doSomeStuff() {
// Doing a lot of complex stuff
}
}
const myServiceMock = createMock(MyService)
myServiceMock.doSomeStuff // That method is now an instance of jest.fn()