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

Support `resolves` or `rejects` (assertions for promises)

Open Pet3ris opened this issue 3 years ago • 3 comments

Jest seems to have good support for promises with assertions: https://jestjs.io/docs/en/asynchronous#promises, which may be useful to provide.

Pet3ris avatar Aug 16 '20 17:08 Pet3ris

There's already testPromise. Do you think that's not sufficient?

glennsl avatar Aug 16 '20 17:08 glennsl

@glennsl it doesn't seem as nice / aligned syntactically but functionally sufficient for sure!

Pet3ris avatar Aug 16 '20 19:08 Pet3ris

I'm not really a fan of offering multiple ways of doing something, but since it's a pattern in jest, and as long as it's feasible, I'm not opposed to it. And at least API-wise it seems like it should line up well with the bs-jest approach of requiring a single assertion to be returned.

glennsl avatar Aug 17 '20 13:08 glennsl