feat: add tests - #3
Merged
Merged
Conversation
added 11 commits
February 2, 2026 16:35
There was a problem hiding this comment.
Pull request overview
This PR adds comprehensive test coverage to the AbacatePay Elixir SDK using ExUnit and Mimic for mocking. The test suite covers API modules, HTTP client functionality, struct transformations, utility functions, and schema validations. Additionally, the PR includes minor improvements to code documentation and README formatting, plus bug fixes for missing fields in the Withdraw and Billing struct conversions.
Changes:
- Added comprehensive test suite using ExUnit and Mimic for all major components
- Fixed missing
descriptionfield inWithdraw.build_api_withdraw/1 - Fixed nil metadata handling and added missing
idfield inBilling.build_api_billing/1 - Updated README.md to use hex.pm installation and fixed code block indentation
- Updated struct moduledocs to be more concise
Reviewed changes
Copilot reviewed 36 out of 36 changed files in this pull request and generated 9 comments.
Show a summary per file
| File | Description |
|---|---|
| test/test_helper.exs | Test configuration with Mimic setup and bypass initialization |
| test/support/mock_http_server.ex | Mock HTTP server implementation for testing API calls without network requests |
| test/http_client_test.exs | Tests for HTTP client GET, POST, PUT, DELETE methods and error handling |
| test/abacatepay/util_test.exs | Comprehensive tests for signature verification, enum conversion utilities |
| test/abacatepay/struct/*.exs | Tests for struct creation, API conversion, and roundtrip transformations |
| test/abacatepay/schemas/*.exs | Validation tests for NimbleOptions schemas |
| test/abacatepay/api/*.exs | Integration tests for all API endpoints with error scenarios |
| test/abacatepay/api_error_test.exs | Tests for ApiError struct and exception behavior |
| mix.exs | Added elixirc_paths configuration to include test/support in test environment |
| lib/abacatepay/struct/withdraw.ex | Fixed missing description field in build_api_withdraw, updated moduledoc |
| lib/abacatepay/struct/billing.ex | Fixed nil metadata handling, added missing id field, updated typedocs and moduledoc |
| lib/abacatepay/struct/*.ex | Updated moduledocs to more concise format |
| README.md | Fixed installation to use hex.pm, corrected code block indentation |
| CHANGELOG.md | Added entry for test additions |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
nicolasribeiroo
marked this pull request as draft
February 3, 2026 03:27
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Tests, tests, and more tests!
Why
We always need tests, dont we?
What changed
README.md, looks weird.README.mdto install directly in hex.pmBreaking changes
Checklist