# How to test intermediate steps in suspending functions

DevFeed: [How to test intermediate steps in suspending functions](<https://devfeed.tech/articles/how-to-test-intermediate-steps-in-suspending-functions-37170.md>)

Original publisher: [Read original article](<https://arkadiuszchmura.com/posts/how-to-test-intermediate-steps-in-suspending-functions/>)

Published: 2022-09-30T00:00:00Z

Content type: tutorial

Language: en

Sources: [Arkadiusz Chmura](<https://devfeed.tech/sources/arkadiusz-chmura.md>)

Topics: [Testing](<https://devfeed.tech/topics/testing.md>), [Coroutines](<https://devfeed.tech/topics/coroutines.md>), [execution](<https://devfeed.tech/topics/execution.md>)

Tags: [code-testing](<https://devfeed.tech/tags/code-testing.md>), [coroutines](<https://devfeed.tech/tags/coroutines.md>), [dispatcher](<https://devfeed.tech/tags/dispatcher.md>), [scheduler](<https://devfeed.tech/tags/scheduler.md>), [testing](<https://devfeed.tech/tags/testing.md>), [virtual](<https://devfeed.tech/tags/virtual.md>)

## AI overview

This tutorial explains how to test intermediate state changes inside suspending functions. It shows how coroutine test dispatchers and virtual-time controls can verify behavior before and after a suspended network call without waiting through real delays.

## Source excerpt

Testing the final result of a suspending function is easy, but what about verifying what happens inside it during the execution?