Hi,
I have a code that is doing some property testing using ScalaCheck and ScalaTest. I'll try to make a simple scenario:
I have types A and B, methods f1 and f2 both A => Future[B] and some equality method areEquals(b1: B, b2: B): Boolean
So, with an Arbitrary[A], I do a forAll that calls f1 and f2, Await.result to get the actual values from the Futures, and then calls areEquals to see that f1 and f2 return the same B for the same A.
Now let's say I want to compile this for scala.js. I don't have access to Await.result anymore because I can't block.
It's also easy to create a method areEquals(f1: Future[B], f2: Future[B]): Future[Boolean]
Good news, I can return a Future if I use AsyncFunSuite. Bad news, I think I also need changes in ScalaCheck. Basically, I think forAll should flatMap on each iteration because now each iteration returns a Future.
Is this correct? Or do you know if there's a way to do this with the current version of ScalaTest 3 and no changes in ScalaCheck?
Thanks!
Luciano