rescript-spy

1.0.0 • Public • Published

ReScript Spy

Test utility to check function calls

Install

$ yarn add rescript-spy

Then, add it to you're bsconfig.json's dev dependencies:

 "bs-dev-dependencies": [
+   "rescript-spy"
 ]

Usage

let (spy, calls) = Spy.make2((a, b) => a + b)

let _ = spy(1, 2)
let _ = spy(2, 3)

calls // [(1, 2), (2, 3)]
Spy.clear(calls)

let _ = spy(3, 4)
calls // [(3, 4)]

Readme

Keywords

Package Sidebar

Install

npm i rescript-spy

Weekly Downloads

58

Version

1.0.0

License

MIT

Unpacked Size

7.59 kB

Total Files

15

Last publish

Collaborators

  • bloodyowl