You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
test('test using promises',asyncfunction(t){constresult=awaitsomeAsyncThing();t.ok(result);});
This to me strongly suggests Tape supports async.
Though I see no t.plan() or t.end(), which confuses me...
And indeed my test does not end... Even not after adding a call to t.end()...
So I perused the issue list where I found this issue:
You can't really pass an async function to tape because tape does not do anything with the promise it returns.
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?
The text was updated successfully, but these errors were encountered:
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 no
t.plan()
ort.end()
, which confuses me...And indeed my test does not end... Even not after adding a call to
t.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?The text was updated successfully, but these errors were encountered: