-
Notifications
You must be signed in to change notification settings - Fork 93
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
Scala.js 1.0.1 support #114
Comments
Thank you for reporting! Have you tried updating scalaJSLinkerConfig as the message recommends? |
Thanks. I investigated both issues. Yes, the linking errors disappear after setting the module kind to CommonJS. Is MUnit supposed to only work when emitting CommonJS modules? As for Bloop, I could fix it by placing |
I accidentally marked the issue as closed.
MUnit has a few facades for If there is an alternative way to achieve the same functionality without the CommonJS module requirement then I'm happy to merge a PR making such a change.
Does Seed sort the classpath? If so, what sorting do you use? The ordering of jars has significant meaning and the control over the ordering should ideally be left to end users. The cause of this issue is likely that MUnit contains interfaces for JUnit here https://github.com/scalameta/munit/tree/f61429f66f8fd81ee71e6c10dc2fe212073b5b07/munit/non-jvm/src/main/scala/org/junit It looks like
We may be able to fix the issue by changing the MUnit runner to be an abstract class instead to match the actual JUnit |
When the libraries `scalajs-test-interface` and `scalajs-junit-test-runtime` are placed before MUnit in the classpath, the following linking error occurs: ``` org.junit.runner.Runner (of kind Class) is not a valid interface implemented by munit.MUnitRunner (of kind Class) ``` Solve this by defining an `abstract class` instead of a `trait` to match JUnit's [`Runner`](https://junit.org/junit4/javadoc/4.12/org/junit/runner/Runner.html). See also scalameta#114.
Thanks for your thorough analysis! The facades look correct. Reading the documentation, the Seed sorts the classpath by name using Scala's |
For newer Scala.js versions, the `scalajs-test-bridge` artefact must be added to the classpath. Further changes were made to improve compatibility with the MUnit testing library: 1. Add build setting allowing to specify Scala.js module kind 2. Fix ordering of classpath in generated Bloop configuration files See also: - scalacenter/bloop#1234 - scalameta/munit#114
Sounds good! I triggered a 0.7.5 release with your fix! |
Thanks! |
I am trying to use MUnit with Scala.js 1.0.1 and Scala 2.13, but the linker is encountering errors:
Here is a minimal sbt project exhibiting the faulty behaviour.
I have also tried it with Bloop (using scalacenter/bloop#1234) and am getting the following errors:
The Bloop classpath looks fine though:
The text was updated successfully, but these errors were encountered: