-
Notifications
You must be signed in to change notification settings - Fork 363
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Future question #1682
Comments
Similarly to Scala.js, we have a single hardware thread at the moment. So |
I am not familiar with the implementation of Scala.JS scalalib override, but minitest works ok on Scala.JS, and so did Minitest's Future/Promise/Await stub. object Future {
def apply[A](f: => A): Future[A] =
new Future(Try(f))
def successful[A](value: A): Future[A] =
new Future(Success(value))
def failed[A](e: Throwable): Future[A] =
new Future(Failure(e))
} |
Here's a workaround that seems to work for me: object Await {
def result[A](future: Future[A], duration: Duration): A = {
scala.scalanative.runtime.loop()
future.value.get.get
}
} |
Very nice workaround! Thank you. |
I tried to unstub Future in eed3si9n/verify#16 following monix/minitest#41, but it doesn't seem to work.
The text was updated successfully, but these errors were encountered: