britzl / deftest

Unit testing in Defold

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

How to run async tests?

endel opened this issue · comments

Hi @britzl, thanks as always for your time for developing tooling around Defold.

I have a question regarding async() tests. The busted documentation mentions the usage of async() / done() (http://olivinelabs.com/busted/#async-tests)

But when using it in deftest I get this error:

attempt to call global 'async' (a nil value)

Is there a different way of calling async() / done() through your wrapper?
Cheers!

Hi @endel ! Deftest is using Telescope, not Busted! Each test is run using a coroutine which means that you should be able to use coroutine.yield() and coroutine.resume(co) when writing async tests.