allain / expect

helpers for writing jest like expect tests in deno
ISC License
45 stars 14 forks source link

Allow `expect()` to work with any awaitable. #25

Closed cowboyd closed 2 years ago

cowboyd commented 2 years ago

resolves #24

We want to be able to have anything that the JavaScrit runtime can await be a valid argument to an expect().resolves or expect().rejects expression. Currently however, it will only work for instances of the builtin Promise constructor.

This replaces the instanceof check with a check for a then() function.

allain commented 2 years ago

Thanks