-
Notifications
You must be signed in to change notification settings - Fork 100
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
Fix ScalaMock for SJS 1.x #362
Conversation
great PR, much appreciated! I've never worked myself with scala.js so the compatibilty has always been a bit dodgy. I've trusted CI to flag up problems, but are you saying it doesn't actually run these? |
I'm glad you like it. I think you don't need to introduce any further steps to the CI, as |
I've pushed v5.1.0 to maven central in case you want to update |
Pull Request Checklist
Purpose
Hi! During the migration to SJS 1.x in one of our projects, I've noticed practically none of our mocks made with ScalaMock work, failing with a runtime error. You can replicate the issue on my branch at the point where I enabled JS testing (def240d) by running
scalamockJS/test
:After a bit of digging it turned out the JS property names are generated differently and no longer match the implementation in
org.scalamock.clazz.MockFunctionFinderImpl
.This PR:
shared
andscalamockJS
- scalatest and specs were not included, so no suites were ran at all@JSExport
annotation to generated mock methodsBackground Context
scalajs-stubs
to provideJSExport
uniformly, but it didn't work on 2.11 and a check at the macro level was not too complex