Comments (2)
Hey Noah, you can mock the web3 object and set web3 before you run your test (i.e. window.web3 = yourWeb3Mock
). It looks like you're already halfway there.
You can check out the react-web3 repo to see how he wrote his tests and how he mocked window.web3
- https://github.com/coopermaruyama/react-web3/tree/master/test
from web3-react.
thanks @gohuygo! The @ next release actually switches over the testing framework to Jest + react-resting-library, and though I still haven't gotten around to making the web3
mocks, I think it'll be pretty straightforward! Also, since using the injected web3
object is no longer a default/required pattern to use web3-react
, it's not as big of an issue.
That being said, still trying to find time to write more extensive tests!
from web3-react.
Related Issues (20)
- How to connect Trezor wallet using web3-react v8
- How can I get provider url from connected wallet? HOT 2
- Why is `connector.deactivate` always undefined? HOT 1
- **The latest updates on your projects**. Learn more about [Vercel for Git ↗︎](https://vercel.link/github-learn-more)
- Walletconect v2 chains not supported
- V3-core
- TypeError: Object(...) is not a function (WalletConnectV2) HOT 1
- How can I sign a transaction using web3-react library?
- dotnet add package dotnetstandard-bip39 --version 1.0.2
- Something happend with intendation
- How can I send transaction to ethereum via metamask?
- tags` as well.beezywqp
- How can i connect okx wallet (web3-react v6) ??
- Did Uniswap abandon this repo? HOT 1
- gm
- How can i use network connection as a fallback connector? HOT 1
- Issue with useWeb3React chainId property when changing Network in MetaMask mobile (WalletConnect v2 connector) HOT 1
- WalleConnectV2 deactivate HOT 1
- connect function from useWalletConnect does not trigger the injectedWallet module automatically
- Missing or invalid. emit() chainId: eip155:11155111. & Cannot convert undefined or null to object at Function.keys (<anonymous>) HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from web3-react.