Skip to content

chore: added tests for libertepay#9

Merged
noelzappy merged 1 commit into
mainfrom
test/liberte-pay
Feb 5, 2026
Merged

chore: added tests for libertepay#9
noelzappy merged 1 commit into
mainfrom
test/liberte-pay

Conversation

@noelzappy

Copy link
Copy Markdown
Owner

This pull request introduces comprehensive unit tests for the LibertePayAdapter in the Voltax Node.js package, ensuring robust validation and correctness of its integration with the LibertePay payment provider. Additionally, it updates the package version to reflect these improvements. There is also a minor formatting change in an unrelated API route.

LibertePayAdapter Testing Improvements:

  • Adds a new test suite libertepay.adapter.test.ts that covers the following for LibertePayAdapter:
    • Constructor validation, including secret key requirements and correct Axios configuration for both test and production environments.
    • initiatePayment method, testing input validation, error handling, and successful payment initiation scenarios.
    • verifyTransaction method, covering all possible transaction states (success, failed, reversed, abandoned, pending) and correct status mapping.
    • getPaymentStatus method, ensuring it returns the correct status based on transaction verification results.

Package Management:

  • Updates the package version in package-lock.json from 0.1.0 to 0.2.0 to reflect the addition of new tests and improvements.

Minor Code Formatting:

  • Adds a trailing comma to the error response in the create-payment API route for consistency.

Copilot AI review requested due to automatic review settings February 5, 2026 20:29
@noelzappy
noelzappy merged commit 7c0530a into main Feb 5, 2026
4 of 6 checks passed

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 pull request adds comprehensive unit tests for the LibertePayAdapter payment provider in the Voltax Node.js package. The tests ensure proper validation, error handling, and status mapping for the LibertePay integration. The package version is appropriately bumped from 0.1.0 to 0.2.0 to reflect these improvements.

Changes:

  • Adds complete test suite for LibertePayAdapter covering constructor, payment initiation, transaction verification, and status retrieval
  • Updates package version to 0.2.0 in both package.json and package-lock.json
  • Fixes trailing comma formatting in create-payment route to match codebase conventions

Reviewed changes

Copilot reviewed 2 out of 3 changed files in this pull request and generated no comments.

File Description
packages/node/src/providers/libertepay/libertepay.adapter.test.ts New comprehensive test suite for LibertePayAdapter with 338 lines covering all adapter methods and scenarios
packages/node/package-lock.json Version bump from 0.1.0 to 0.2.0 reflecting the addition of test coverage
examples/nextjs/src/app/api/libertepay/create-payment/route.ts Minor formatting fix adding trailing comma for consistency with codebase style
Files not reviewed (1)
  • packages/node/package-lock.json: Language not supported

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

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.

2 participants