ShouldJs Typescript issues with promises

94 Views Asked by At

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

1

There are 1 best solutions below

0
Lev Kuznetsov On

Created an issue against should repo, in the meantime casting to any works