Skip to content
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

Tests run concurrently within a TestSuite on Scala.js #358

Closed
armanbilge opened this issue Jan 9, 2025 · 0 comments · Fixed by #359
Closed

Tests run concurrently within a TestSuite on Scala.js #358

armanbilge opened this issue Jan 9, 2025 · 0 comments · Fixed by #359

Comments

@armanbilge
Copy link
Contributor

//> using dep com.lihaoyi::utest::0.8.4
//> using platform js

import utest._
import scala.concurrent._

object Demo extends TestSuite {
  def tests = Tests {
    test("foo") {
      println("foo started")
      Future(println("foo ended"))(ExecutionContext.global)
    }
    test("bar") {
      println("bar started")
      println("bar ended")
    }
  }
}
-------------------------------- Running Tests --------------------------------
foo started
bar started
bar ended
+ Demo.bar 0ms  
foo ended
+ Demo.foo 58ms  
Tests: 2, Passed: 2, Failed: 0

This is problematic when testing React applications using act:

Warning: You seem to have overlapping act() calls, this is not supported. Be sure to await previous act() calls before making a new one.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant