kotlinx-coroutines-test 是一个用于协程测试的模块,它允许你在测试中模拟和控制协程的行为。该模块提供了一些工具,如 TestCoroutineDispatcher 和Dispatchers.setMain,以便在测试环境中替换默认的协程调度器。 3. 使用 dispatchers.setMain 替代默认的 Main Dispatcher 在测试中,如果你需要模拟主线程的行为,但不想依赖...
kotlinx-coroutines-test api common js jvm native npm wasmJs wasmWasi MIGRATION.md README.md build.gradle.kts license reactive site test-utils ui .gitignore CHANGES.md CHANGES_UP_TO_1.7.md CODE_OF_CONDUCT.md CONTRIBUTING.md LICENSE.txt ...
kotlinx-coroutines-test api common js jvm native npm wasmJs wasmWasi MIGRATION.md README.md build.gradle.kts license reactive site test-utils ui .gitignore CHANGES.md CHANGES_UP_TO_1.7.md CODE_OF_CONDUCT.md CONTRIBUTING.md LICENSE.txt ...
test: avoid Dispatchers.Main before setting dispatcher … 953c1b2 build(deps): bump org.jetbrains.kotlinx:kotlinx-coroutines-test … 1a13300 david-allison force-pushed the dependabot/gradle/dependency-updates/org.jetbrains.kotlinx-kotlinx-coroutines-test-1.10.0 branch from 13e60bc to 1...
Bumps org.jetbrains.kotlinx:kotlinx-coroutines-test from 1.10.0 to 1.10.1. Release notes Sourced from org.jetbrains.kotlinx:kotlinx-coroutines-test's releases. Version 1.10.1 Fixed binary incomp...
Move the test facilities lying around `kotlinx-coroutines-core` and their reimplementation in `kotlinx-coroutines-test` into a separate module, on which the other modules now depend. This allows us to have internal testing facilities in common code. After the migration, the test facilities ...
Update kotlinx-coroutines-test #2973 Merged dkhalanskyjb added a commit that referenced this issue Nov 17, 2021 Implement 'runTest' that waits for asynchronous completion (#2978) … 104c507 dkhalanskyjb added a commit that referenced this issue Nov 17, 2021 Implement 'runTest' that...
It was an intentional goal to support using pieces of this library it to build alternative implementations as it sits in kotlinx-coroutines. Before you do - take a look at some of the test cases in the repo that fail with this change to make sure you're happy with the API surface. ...
Consider following scenario Function to test: fun execute(appConfig: AppConfig): Deferred<String> = async { registerDevice(appConfig.serviceId) } private suspend fun registerDevice(serviceId: String): String = suspendCoroutine { //some n...
After update to 0.30.1 I can't run Unit tests because Dispatchers try to initialize Dipsatchers.Main on first access and kotlinx-coroutines-android try to instanciate HandlerDispatcher that can't be done because Handler and Looper don't work on stub Android SDK. For Unit tests I replace...