-
Notifications
You must be signed in to change notification settings - Fork 10
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
[Feature Request] Add support for other mocking frameworks #99
Comments
For reference, I tried to build of version of our internal Detector over here: |
I'd be open to making these mock factories configurable, similar to what we do in compose lints for view model injection - https://github.com/slackhq/compose-lints/blob/main/compose-lint-checks/src/main/java/slack/lint/compose/ViewModelInjectionDetector.kt#L25-L31 |
@ZacSweers I started a draft PR #126 and for now I extracted the previous values as defaults. Also, regarding the potential tests to be added, what would make more sense here?
|
Keeping the defaults sounds good. I think we may also want to unify classes and methods together, i.e. "org.mockito.Mockito.mock" rather than split them. For tests, keeping the existing defaults while added some basic extra tests to test that custom mocking factories are working I think should be enough. |
Fixed in |
Would you consider adding support for another popular mocking framework?
We currently have developped our own ad-hoc Lint detector to report wrong usages of mocks using the Mockk.io library.
But I think we could benefit from running this detection only once our codebase.
It could be done either with a lint config parameter, or maybe simpler by adding the relevant classes/methods in these variables:
slack-lints/slack-lint-checks/src/main/java/slack/lint/mocking/MockDetector.kt
Lines 34 to 41 in fd01ddf
The text was updated successfully, but these errors were encountered: