Skip to content

Improve tests #2

@phyziyx

Description

@phyziyx

Summary

We should add a comprehensive test suite to improve confidence in changes and prevent regressions.

Motivation / Why

  • Improve users confidence when choosing this package.
  • Allow users to create meaningful and correct change requests.
  • Block merges when tests fail.

Scope

Add tests for the SDK’s core behaviors, including:

  1. Client initialization

    • Requires/accepts API key (or other auth configuration if applicable).
    • Validates config options (base URL, timeouts, environment, etc.).
  2. Requests

    • Correct headers (auth/payload signature)
    • Correct JSON body serialization and optional fields handling.
  3. Responses

    • Successful responses are parsed correctly into expected shapes.

Acceptance criteria

  • Test framework configured and runnable via npm test (or equivalent).
  • CI job runs tests on PRs and main branch.
  • Code coverage reporting (Let's aim for 90%)
  • Clear contributor docs: how to run and add tests locally.

Out of scope (for this issue)

  • End-to-end tests against the real Antilopay API: Since we do not have access to a sandbox environment.
  • Run time type safety tests: To keep the project light weight, I have decided not to use a run-time type validation package such as Zod/ArkType. It is expected that common sense will be employed when writing code using this package.

Notes / Open questions

  • Unsure if we should implement integration tests, and mock requests and responses.

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions