This repository was archived by the owner on Mar 5, 2025. It is now read-only.
How to mock a ethereum web3HttpProvider for unit testing of REST API? #5065
Unanswered
vineetaparodkar
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
REST API has following basic structure(index.js)where provider, wallets are created using web3HttpProvider and etherjs when server is started.
Index.js
Solution tried: index.test.js
Which results in web3HttpProvider is not a constructor. How to properly mock web3HttpProvider and etherjs to write unit test for REST APIs?
Beta Was this translation helpful? Give feedback.
All reactions