How to mock a ethereum provider for unit testing of REST API with jest? #3015
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