Skip to content

feat: add tests - #3

Merged
almeidazs merged 12 commits into
AbacatePay:mainfrom
nicolasribeiroo:add-tests
Feb 3, 2026
Merged

feat: add tests#3
almeidazs merged 12 commits into
AbacatePay:mainfrom
nicolasribeiroo:add-tests

Conversation

@nicolasribeiroo

@nicolasribeiroo nicolasribeiroo commented Feb 2, 2026

Copy link
Copy Markdown

Summary

Tests, tests, and more tests!

Why

We always need tests, dont we?

What changed

  • Use ExUnit for making tests.
  • Use Mimic to create useful mock modules.
  • Add tests for api modules, http client, structs and utils.
  • Fix code tabs in README.md, looks weird.
  • Change installation guide in README.md to install directly in hex.pm

Breaking changes

  • Yes
  • No

Checklist

  • Docs updated
  • CI passing
  • I followed the CONTRIBUTING guidelines
  • I added or updated tests (if applicable)

@nicolasribeiroo
nicolasribeiroo marked this pull request as ready for review February 3, 2026 03:20
Copilot AI review requested due to automatic review settings February 3, 2026 03:20

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 description field in Withdraw.build_api_withdraw/1
  • Fixed nil metadata handling and added missing id field in Billing.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.

Comment thread lib/abacatepay/struct/store.ex Outdated
Comment thread lib/abacatepay/struct/withdraw.ex Outdated
Comment thread lib/abacatepay/struct/public_mrr.ex Outdated
Comment thread lib/abacatepay/struct/pix.ex Outdated
Comment thread lib/abacatepay/struct/coupon.ex Outdated
Comment thread lib/abacatepay/struct/billing.ex Outdated
Comment thread lib/abacatepay/struct/product.ex Outdated
Comment thread lib/abacatepay/struct/customer.ex Outdated
Comment thread test/abacatepay/api/store_test.exs Outdated
@nicolasribeiroo
nicolasribeiroo marked this pull request as draft February 3, 2026 03:27
@nicolasribeiroo
nicolasribeiroo marked this pull request as ready for review February 3, 2026 21:16
@almeidazs
almeidazs merged commit ec1ad45 into AbacatePay:main Feb 3, 2026
2 checks passed
@nicolasribeiroo
nicolasribeiroo deleted the add-tests branch February 3, 2026 21:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants