Add tests to bitcore-cli#4105
Open
kajoseph wants to merge 36 commits into
Open
Conversation
Co-authored-by: Copilot <copilot@github.com>
Contributor
There was a problem hiding this comment.
Pull request overview
Adds a substantial automated test suite for bitcore-cli (unit tests + end-to-end CLI flows against a local BWS + MongoDB), and adjusts CLI behavior/types to support those tests (wallet creation/join flows, tx proposal pagination/actions, and build/test tooling).
Changes:
- Added extensive
bitcore-clitest coverage (utils/prompts/filestorage + CLI interaction tests for create/join, proposals, addresses). - Updated CLI wallet + txproposals logic to support new scenarios (join secret plumbing, pagination refactor, chain-specific behavior, token lookup scoping).
- Updated build/test tooling (prod tsconfig, test scripts, test wallet fixtures, and new dev deps for running an embedded BWS + MongoDB).
Reviewed changes
Copilot reviewed 29 out of 31 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
| packages/bitcore-wallet-client/src/index.ts | Re-exports Constants from BWC for downstream usage. |
| packages/bitcore-cli/types/wallet.d.ts | Updates wallet create() type signature for join-secret flow + new return fields. |
| packages/bitcore-cli/tsconfig.prod.json | Adds prod TS config excluding tests. |
| packages/bitcore-cli/test/wallets/btc-singlesig.json | Adds wallet fixture used by CLI tests. |
| packages/bitcore-cli/test/wallets/btc-multisig-copayer1.json | Adds multisig copayer fixture. |
| packages/bitcore-cli/test/wallets/btc-multisig-copayer2.json | Adds multisig copayer fixture. |
| packages/bitcore-cli/test/utils.test.ts | Adds unit tests for Utils. |
| packages/bitcore-cli/test/tssCoordinator.ts | Adds helper to coordinate multiple CLI processes for TSS tests. |
| packages/bitcore-cli/test/proposals.test.ts | Adds end-to-end tests for viewing/accepting/rejecting/deleting proposals. |
| packages/bitcore-cli/test/prompts.test.ts | Adds tests for prompt helpers (env defaults, validation, cancel flow). |
| packages/bitcore-cli/test/helpers.ts | Adds BWS/Mongo-backed test harness and blockchainExplorer mock utilities. |
| packages/bitcore-cli/test/filestorage.test.ts | Adds tests for FileStorage behavior. |
| packages/bitcore-cli/test/data/walletsData.ts | Adds BWS wallet seed data for tests. |
| packages/bitcore-cli/test/data/test-config.ts | Adds test config for Mongo/BWS ports. |
| packages/bitcore-cli/test/data/proposalsData.ts | Adds BWS proposal seed data. |
| packages/bitcore-cli/test/data/addressesData.ts | Adds BWS address seed data. |
| packages/bitcore-cli/test/create.test.ts | Adds end-to-end tests for single-sig, multisig, and TSS wallet creation/join flows. |
| packages/bitcore-cli/test/commands.test.ts | Fixes type import paths for command tests. |
| packages/bitcore-cli/test/address.test.ts | Adds end-to-end tests for address generation + pagination. |
| packages/bitcore-cli/src/wallet.ts | Adds join-secret support to create(), adjusts completion/save logic, adds regtest currency URL requirement. |
| packages/bitcore-cli/src/utils.ts | Adjusts goodbye messages, parseAmount() error behavior, and documents paginate() types. |
| packages/bitcore-cli/src/commands/txproposals.ts | Refactors proposal viewing/actions onto shared paginator, adds --page option. |
| packages/bitcore-cli/src/commands/token.ts | Restricts token lookup to the wallet’s chain. |
| packages/bitcore-cli/src/commands/join/joinMultiSig.ts | Routes multisig join through wallet.create({ joinSecret }). |
| packages/bitcore-cli/src/commands/join/index.ts | Blocks Solana for multi-party join flows. |
| packages/bitcore-cli/src/commands/create/index.ts | Disables multi-party prompt for Solana creation. |
| packages/bitcore-cli/src/commands/create/createThresholdSig.ts | Adds explicit Solana guard for TSS creation. |
| packages/bitcore-cli/src/commands/create/createMultiSig.ts | Adds explicit chain support guard for multisig creation. |
| packages/bitcore-cli/package.json | Updates test/coverage scripts (copy fixtures, --exit), adds prod build, adds test deps. |
| packages/bitcore-cli/package-lock.json | Locks new dev dependencies (BWS, mongodb, supertest, etc.). |
| packages/bitcore-cli/copyTestWallets | Adds helper script to copy wallet fixtures into build output for tests. |
Files not reviewed (1)
- packages/bitcore-cli/package-lock.json: Language not supported
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot <copilot@github.com>
Contributor
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 40 out of 43 changed files in this pull request and generated 7 comments.
Files not reviewed (2)
- packages/bitcore-cli/package-lock.json: Language not supported
- packages/bitcore-wallet-client/package-lock.json: Language not supported
…ds on wallet creation
…d infinite recursion
MichaelAJay
reviewed
May 12, 2026
MichaelAJay
reviewed
May 12, 2026
MichaelAJay
reviewed
May 13, 2026
MichaelAJay
reviewed
May 13, 2026
MichaelAJay
reviewed
May 13, 2026
MichaelAJay
reviewed
May 13, 2026
MichaelAJay
reviewed
May 13, 2026
MichaelAJay
reviewed
May 13, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Need more tests in bitcore-cli
Changelog
tsxdependency from BWCTesting Notes
cd packages/bitcore-cli && npm run testChecklist