Skip to content

Commit 1996f90

Browse files
thephezclaude
andauthored
test: add setupDashClient unit tests and mnemonic validation (#61)
* test: add setup dash client test cases and related dependencies * test: use dip13KeyPath() in test helper and add setupDashClient coverage Replace hardcoded DIP-13 path construction in deriveKeysFromMnemonic with the exported dip13KeyPath() helper, ensuring a single source of truth for path derivation. Add test cases for missing setupDashClient() permutations including undefined manager guards, requireIdentity flag, and identityIndex forwarding. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * fix: validate mnemonic in setupDashClient before key derivation Catch invalid BIP39 mnemonics early with a clear error message instead of letting them propagate to the WASM SDK as opaque WasmSdkError objects. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * test: add dip13KeyPath unit tests for path derivation Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * test: deepen assertions and add stubbed tests for untested paths Verify key-role correctness (keyId per getSigner method), signer depth (keyCount for getMaster/getFullSigner), createClient success branches (testnet/mainnet isConnected), findNextIndex loop logic with stubbed occupied indices, createForNewIdentity nonzero auto-index, and AddressKeyManager getInfo/getInfoAt with stubbed SDK. Fix stale comment and remove weak clientConfig direct-usage tests. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * chore: update test scripts Don't run setup in test:all * chore: update mocha to latest and pin * build: move dotenv from devDependencies to dependencies Tutorials depend on dotenv to load .env files, so it should be a regular dependency to ensure it is available after `npm install`. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * test: skip mnemonic-dependent tests when PLATFORM_MNEMONIC is unset Fork PRs don't have access to repository secrets, so identity-retrieve fails in CI. Skip tests marked with requiresMnemonic when the env var is absent. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 9115cda commit 1996f90

5 files changed

Lines changed: 2172 additions & 104 deletions

File tree

0 commit comments

Comments
 (0)