Hi everyone,
I wanted to recreate some sinon-chai API with rescript and pipe operator. Everything was going great when the last value in a chain was a function. But I’m not able to get something like that to work:
expect(spy).to.be.called
This is my binding function:
@val external expectBinding: (. 'a) => 'a = "expect"
let expect = rule => expectBinding(. rule)
@scope(("to", "be")) @send
external toBeCalled: 'element => unit = "called"
But this compiles down to something like this:
expect(spy).to.be.called()
When I deleted parenthesis at the end everything works great. Unfortunately I don’t if it’s possible to force the compiler to drop final parens.
Or maybe my approach is wrong and I need to write this type of bindings in a different way?
I read through documentation but I couldn’t find anything similar. I was hoping maybe you guys could point me in the right direction