Add tests to bitcore-cli#4105
Conversation
Co-authored-by: Copilot <copilot@github.com>
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.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 39 out of 42 changed files in this pull request and generated 10 comments.
Files not reviewed (2)
- packages/bitcore-cli/package-lock.json: Language not supported
- packages/bitcore-wallet-client/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>
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
Description
Need more tests in bitcore-cli
Changelog
tsxdependency from BWCTesting Notes
cd packages/bitcore-cli && npm run testChecklist
BWCif modifying the bitcore-wallet-client package,CLIif modifying the bitcore-cli package, etc.)