@kojiro.ueda/bandia
TypeScript icon, indicating that this package has built-in type declarations

0.0.6 • Public • Published

Node.js CI

bandia

Create mock object for Jest.

how to use

import { mock } from "@kojiro.ueda/bandia";

class Test {
  method1() {
    return true;
  }
}

describe("test", () => {
  it("should mocked", () => {
    const instance = mock<Test>();
    instance.method1.mockReturnValueOnce(false);
    
    expect(instance.method()).toBe(false);
  });
});

Readme

Keywords

none

Package Sidebar

Install

npm i @kojiro.ueda/bandia

Weekly Downloads

5

Version

0.0.6

License

MIT

Unpacked Size

19.2 kB

Total Files

25

Last publish

Collaborators

  • kojiro.ueda