I'm getting a compile error in typescript with shouldjs only when trying to use the .rejected() / .fufilled()
syntax
Promise.resolve().should // is fine, is an Assertion
Promise.resolve().should.rejected // is fine, is a Function
Promise.resolve().should.rejected() // TS2349 Cannot invoke expression whose type lacks a call signature. Type Promise<any> has no compatible call signatures
I tried casting to PromisedAssertion
like this: (<PromisedAssertion>Promise.resolve())
or (Promise.resolve() as PromisedAssertion)
to no effect. How can I fix this?
.should
works fine otherwise