Skip to content

TestProbe could break unit tests #105

@hoangong

Description

@hoangong

Hi,

it seems that TestProbe can only be called 5 times. after that it breaks the test. I have a unit test like this:

class DatasetViewTest extends TestKit(ActorSystem("test")) with FlatSpecLike with Matchers {

  trait TestContext {
    val controller = TestProbe()
  }

  it should "1" in new TestContext  {}
  it should "2" in new TestContext  {}
  it should "3" in new TestContext  {}
  it should "4" in new TestContext  {}
  it should "5" in new TestContext  {}
  it should "6" in new TestContext  {}
  it should "7" in new TestContext  {}
  it should "8" in new TestContext  {}
  it should "9" in new TestContext  {}
  it should "10" in new TestContext {}
}

Only test 1-5 could run. then it stops with this error:

[error] (management / Test / testOnly) org.scalajs.testcommon.RPCCore$ClosedException: org.scalajs.jsenv.ComJSEnv$ComClosedException: JSCom has been closed

I could put val controller = TestProbe() outsite scope of TestContext as a workaround, but some cases I have to redeclare it.

Thanks.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions