Skip to content

Bug for shared tests running under JS under specific latest versions #33

@ryan-richt

Description

@ryan-richt

Using library dependencies

"org.scalacheck" %%% "scalacheck" % "1.14.3" % "test",
"org.scalatest" %%% "scalatest" % "3.1.2" % "it,test",
"org.scalatestplus" %% "scalacheck-1-14" % "3.1.2.0" % "test"

In a scalajs 1.0.0 sbt cross-built project, there is a subtle bug where if the above-mentioned org.scalatestplus dependency is included in the project, tests in the standard "shared" directory (which are compiled to both JVM and JS flavors and the tests are then run by ScalaTest twice, once in each environment) fail to run in the JS environment (we are using jsEnv := new org.scalajs.jsenv.jsdomnodejs.JSDOMNodeJSEnv) with the error:

[info] Fast optimizing ...evilplot/js/target/scala-2.13/evilplot-test-fastopt.js
[info] ScalaTest
[info] Run completed in 88 milliseconds.
[info] Total number of tests run: 0
[info] Suites: completed 0, aborted 0
[info] Tests: succeeded 0, failed 0, canceled 0, ignored 0, pending 0
[info] No tests were executed.
[error] Error: Total 1, Failed 0, Errors 1, Passed 0
[error] Error during tests:
[error] 	com.cibo.evilplot.numeric.KernelDensityEstimationSpec
[info] Closure: 0 error(s), 0 warning(s)

Dropping that one scalatestplus dependency restores running and passing of the test. Note that this test (and no tests in the repo) actually need to USE scalacheck or the ScalaCheckPropertyChecks trait for this bug to be triggered. Just including/excluding the dependency was sufficient.

I think this is the latest of all these dependencies, but it is not the README.md recommended set. Downgrading to ScalaTest 3.1.0 seems be be a no-go b/c it does not seem to be published for ScalaJS 1.0.0 + Scala 2.13. Downgrading to ScalaTest 3.1.1 is published for those two, but in combination with "scalacheck-1-14" % "3.1.1.0", produces the same mysterious error.

Thank you!

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