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

[Discussion] mocking framework? #89

Open
xxxserxxx opened this issue Dec 19, 2024 · 1 comment
Open

[Discussion] mocking framework? #89

xxxserxxx opened this issue Dec 19, 2024 · 1 comment

Comments

@xxxserxxx
Copy link
Collaborator

xxxserxxx commented Dec 19, 2024

Can we agree on a mocking framework to use in the project?

The lack of unit tests is starting to make things difficult, especially as collaboration increases. Unit tests for stmps are particularly difficult because of the TUI nature of the project, but also in the Subsonic integration; thankfully, the latter can be easily solved with mock servers.

There are several options from which to choose:

  • mockery, 160 releases, 128 contributors, updated 2 weeks ago
  • counterfeiter, 21 releases, 34 contributors, updated last week,
  • minimock, 43 releases, 15 contributors, updated last month
  • mocktail, 11 releases, 9 contributors, updated 8 mos ago

I have no preference; just that we pick an official one. I'd rather not have to change the tooling once we start using it.

Edit I still have no preference, except that either of the first two look preferrable to the second two. I've used mockery before, but not yet counterfeiter. I haven't used mockery a lot, though, so they're probably about equal in adoption difficulty for me. I've also used mocktail, but for some reason defaulted to mockery in my projects that have mocking. mocktail appears to prefer something other than testify, which I have used a lot, and I feel as if leveraging testify is a benefit. I'll be fine with any decision.

@xxxserxxx
Copy link
Collaborator Author

mockery requires a metadata file; I prefer tools that don't require extra yaml config files in the repo, so mockery has dropped down on my list.

In the meantime, I've come across more options:

  • hel -- looks quite promising, and projects hosted on Sourcehut smell better
  • moq
  • pegomock

In the absence of external input or recommendations, I'm going to try a few and pick one fore the xxxserxxx fork. I'm getting more desperate for better unit tests.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant