Skip to content

test: add coverage for transactions receipt command - #50

Closed
iborazzi wants to merge 1 commit into
ProjectOpenSea:mainfrom
iborazzi:test/add-transactions-receipt-coverage
Closed

iborazzi wants to merge 1 commit into
ProjectOpenSea:mainfrom
iborazzi:test/add-transactions-receipt-coverage

Conversation

@iborazzi

Copy link
Copy Markdown
Contributor

Motivation

src/commands/transactions.ts (the transactions receipt command) had 0% test coverage, found via npx vitest run --coverage. It reads a JSON request body from --request, and had no tests for the success path or for a missing/invalid file.

Solution

Adds test/commands/transactions.test.ts covering:

  • successful --request parsing and POST to /api/v2/transactions/receipt
  • missing --request file
  • invalid JSON in the --request file
  • missing required --request option

Follows the same temp-file pattern already used in test/commands/orders.test.ts and test/parse.test.ts (mkdtempSync, not a Date.now() suffix, to avoid path collisions on concurrent runs). Coverage for this file goes from 0% to 100% statements/lines.

@ryanio

ryanio commented Sep 19, 2026

Copy link
Copy Markdown
Collaborator

Thanks for adding this coverage. We recreated the tests in our internal monorepo, including cleanup of the temporary directory, and they will reach this mirror in a future sync. This repository is read-only, so we're closing the PR here. We appreciate the contribution.

@ryanio ryanio closed this Sep 19, 2026
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