Closed otakustay closed 6 years ago
This is documented in the README for nodent (which underlies fast-async). Look at the section "await non-Promise" in https://github.com/MatAtBread/nodent#gotchas-and-es7-compatibility.
TLDR; you need to set wrapAwait: true
option.
Incidentally, in your example, getSearchCount is not marked as async
, which works in nodent
, but not fast-async
, since it is an extension of the specification supported by nodent.
In such code:
fast-async will generate wrong code such as (copied from console):
which obviously leads to error (object does not have
then
method)