We want to make contributing to this project as easy and transparent as possible.
Ideally, unit tests should accompany every newly introduced exported function. We're always striving to increase the project's test coverage.
If you need to mock an interface in your tests, follow the next steps:
-
Comment the interface you'd like to mock following the example below
//go:generate mockery --name=nameOfClient --output=. --case=underscore --inpackage type nameOfClient interface { ... }
Remember to set the
--name
argument accordingly. For real-life implementation examples, check out existing services, for example fcm. -
Run
make mock
The first time you'll also need to run
make setup
to download the packages required to generate your mocks -
Use the mocked interface in your tests
mockClient := newMockNameOfClient(t)
Commit messages should be well formatted, and to make that "standardized", we are using Conventional Commits.
You can follow the documentation on their website.
We actively welcome your pull requests.
- Fork the repo and create your branch from
main
. - If you've added code that should be tested, add tests.
- If you've changed or added exported functions or types, document them.
- We use gofumpt to format our code. Don't forget to always run
make fmt
before opening a new PR. - Ensure the test suite passes and the linter doesn't complain (
make ci
).
We use GitHub issues to track public bugs. Please ensure your description is clear and has sufficient instructions to be able to reproduce the issue.