Closed Download closed 1 year ago
That comment described tape v4 - v5 supports a returned promise from the function, which means it supports async function
. What version are you using?
There's no need for t.end()
because the promise itself fulfilling notifies tape when the test is over.
Ah! That clarifies a lot!
In the mean time I have been doing some testing and it seems that you are right that it is supported as another async function that only calls setTimeout
does finish as expected. So the issue seems to be in my code... as usual.
UPDATE
Did some more testing and figured it out. It has nothing to do with tape
. The issue was that knex
keeps the process alive unless I explictly call destroy
on it or use process.exit
. Thanks for your reply!
I am confused whether
async
is supported in Tape.In the example in the README I see this:
This to me strongly suggests Tape supports
async
. Though I see not.plan()
ort.end()
, which confuses me... And indeed my test does not end... Even not after adding a call tot.end()
...So I perused the issue list where I found this issue:
Test using async/await does not end #358
In there, I see this comment by the author:
I guess the author knows what he is talking about. But this leaves me wondering. Why explicitly give an example of an
async
test when it is not really supported? Should we maybe remove that example from the docs?