rescript-jest icon indicating copy to clipboard operation
rescript-jest copied to clipboard

Handle toHaveBeenCalled

Open Qziem opened this issue 5 years ago • 1 comments

Good to write bindings for toHaveBeenCalled, toHaveBeenCalledWith,... and other methods for mock functions.

Qziem avatar May 15 '20 09:05 Qziem

You can reimplement toHaveBeenCalled with something like this:

let mockFoo = Jest.JestJs.fn(() => ())

expect(mockFoo->Jest.MockJs.calls->Js.Array2.length)->JExp.not_->JExp.toBe(0, _)

But, yeah, it would be great to have more bindings out of the box :)

DZakh avatar May 23 '21 11:05 DZakh