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
Lint
Lint Not Applicable
Unit
Tests Not Applicable