Depends on D11258.
This adds useWallet test back, with a custom environment to handle issues with jest27 and Uint8Array.
Details
Details
- Reviewers
bytesofman - Group Reviewers
Restricted Owners Package (Owns No Changed Paths) Restricted Project - Commits
- rABC840faaffb19c: [cashtab] fix useWallet test
npm install
npm test
ALL tests should pass.
Diff Detail
Diff Detail
- Repository
- rABC Bitcoin ABC
- Branch
- cashtab/fix-use-wallet-test
- Lint
Lint Passed - Unit
No Test Coverage - Build Status
Buildable 18637 Build 37065: Build Diff Build 37064: arc lint + arc unit
Event Timeline
Comment Actions
- Please rebase to latest master
- Please include a short explanation for the rationale for this change (just in a comment in phab on this diff), so I don't forget again the next time it comes up ;)
web/cashtab-v2/config/jest/uint8array-environment.js | ||
---|---|---|
1 | Some crypto-related libraries we use often targets nodejs only. They work in the browser because webpack shims them (see webpack config, searching for Buffer, there are others too.) That doesn't happen on jest 27 when using the JSDOM environment for tests and it was breaking the useWallet test, because of some external libraries causing the hash generated by the HDNode to not being recognized as Uint8Array. (See: https://github.com/facebook/jest/issues/4422) So that's why this file is needed, we have a custom environment extending JSDOM environment and binding nodejs Uint8Array/ArrayBuffer to it so we are able to run tests. |