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

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

Open
ryan-richt opened this issue Jun 16, 2020 · 0 comments
Open

Comments

@ryan-richt
Copy link

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!

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

No branches or pull requests

1 participant