runBlockingはrunTestに置き換えてもいいかも
- runTestは内部で、delayなどの明らかに処理が止まる処理を、自動でスキップしてくれるなどの処理が備わっている
そのため、テストの実行時間が短くなるなどのメリットがある
(例えばrunBlockingだと、テスト対象メソッドにdelayで10秒待つ処理がると、きっちり10秒待ってからじゃないと、次の処理に進めない。しかし、runTestは、delayで10秒待つ処理があった場合、10秒待ったことにして、次の処理を進めてくれるため、テストにかかる時間が短くなる)
参考サイト
On JVM and Native, this function behaves similarly to runBlocking, with the difference that the code that it runs will skip delays. This allows to use delay in tests without causing them to take more time than necessary. On JS, this function creates a Promise that executes the test body with the delay-skipping behavior.
JVM およびネイティブでは、この関数は と同様に動作しますが、実行するコードが遅延をスキップするという違いがあります。これにより、テストに必要以上の時間をかけずに、テストで遅延runBlockingを使用できます。JS では、この関数は、遅延スキップ動作でテスト本体を実行する を作成します。Promise