Is there anything that exists in scalatest that will wait for a period of time for an assertion to become true?
So, for example, if I have a thread that computes something asynchronously, I want to wait in my test for the computation to equal the expected value.
You most likely want Eventually:
https://www.scalatest.org/scaladoc/3.2.6/org/scalatest/concurrent/Eventually.html
But if your computation is inside a future, you would probably want to use one of the Futures subtraits:
https://www.scalatest.org/scaladoc/3.2.6/org/scalatest/concurrent/Futures.html
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With