When a unit test executes its line line of code the system finishes it and goes to the next test. This means that if we want to test asynchronous code, we need to indicate that our code is goinf to take some time.
We mainly have two types of asynchronous code to test, async
code and closures, both of them need to be tested in different ways:
Async code
In case you need to test any async
function, you can just mark your test as async
as well. This allows you to call you functions asynchronously in order to wait for the result.
Continue reading
Access to all the content with our plans.
- Junior level content
- Senior level content
- Expert level content
- Extra content
- Question submissions
Monthly
Yearly
Be the first to comment