Skip to content

test(assets): add unit tests for transfer subcommand - #49

Closed
iborazzi wants to merge 1 commit into
ProjectOpenSea:mainfrom
iborazzi:test/add-tests-for-assets-transfer
Closed

test(assets): add unit tests for transfer subcommand#49
iborazzi wants to merge 1 commit into
ProjectOpenSea:mainfrom
iborazzi:test/add-tests-for-assets-transfer

Conversation

@iborazzi

Copy link
Copy Markdown
Contributor

Description

Adds unit test coverage for assetsCommand's transfer subcommand in src/commands/assets.ts, which previously had no tests.

Details

  • Tests that the command registers the transfer subcommand correctly.
  • Tests that a valid --body JSON file is read and POSTed to /api/v2/assets/transfer.
  • Tests error handling when the --body file does not exist.
  • Tests error handling when the --body file contains invalid JSON.

All 362 tests pass locally (npx vitest run), including the 4 new tests.

@ryanio

ryanio commented Sep 4, 2026

Copy link
Copy Markdown
Collaborator

Thanks for this. assetsCommand really was the last command module in the CLI with no test file, and covering both readJsonBodyOption failure paths while asserting that no request goes out was the right shape for it.

Recreated in our internal monorepo and shipped in @opensea/cli v2.2.0, with you credited as co-author. This repo is a read-only mirror so we cannot merge PRs here. Closing as shipped.

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