Page MenuHomePhabricator

[Cashtab] Mock getPubKey for unit tests
ClosedPublic

Authored by bytesofman on Feb 7 2022, 21:42.

Details

Reviewers
emack
Group Reviewers
Restricted Project
Commits
rABC54753fdd993d: [Cashtab] Mock getPubKey for unit tests
Summary

Unit tests that called BCH.encryption.getPubKey(address) were actually performing an API call. This call has been mocked in key unit tests. Unit tests that were testing address validation for this endpoint have been removed, as mocking the error messages and comparing such mocks to an error message is not useful.

Test Plan
  1. On the master branch, run npm test. Push a to run all the tests. When they are complete, push a again to run them again. You should see all tests succeed on the first pass, then fail on the second or third pass.
  2. Checkout this diff. Do the same test. Note that they continue to pass without too many requests error, as requests have been removed.

Diff Detail

Repository
rABC Bitcoin ABC
Branch
mock-api-call-in-tests
Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 18184
Build 36176: Build Diffcashtab-tests
Build 36175: arc lint + arc unit