Skip to content

Kotlin suspend test should use runTest. #4768

@JavierSegoviaCordoba

Description

@JavierSegoviaCordoba

Context, this GitHub comment and the ones below it: #1914 (comment)

Furthermore, if suspend tests use runTest, it would be amazing to support specifying a dispatcher via an annotation:

@TestDispatcher(FooDispatcher::class)
class BarTest {

    ...
}

I find it weird to need to replace the dispatcher only on a single test instead of the whole class. @TestDispatcher(FooDispatcher::class) should work if it is also annotating a test method for that use case.

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions