Skip to content

callstack/web3-react-native-testing

Repository files navigation

web3-react-native-testing

This repository showcases how to configure a React Native Expo project with Wagmi, Viem and WalletConnect Web3Modal, and how to write Unit & Integration tests for the main features using Jest, Anvil and React Native Testing Library.

demo.gif

Requirements

  • Expo environment setup (Node.js, Git, Watchman)
  • A Wallet Connect Cloud project ID
  • Expo Go app installed in your smartphone
  • One or more web3 wallets installed in your smartphone (e.g. MetaMask, Rainbow Wallet, Trust Wallet, etc)

Running the application

  • Rename .env.example to .env and fill in your Wallet Connect Cloud project ID
  • npm install
  • npm start
  • Open Expo Go app in your smartphone
  • If your smartphone is in the same network as your computer, the local dev server should appear as the first option. If it doesn't, use the app to scan the QR Code presented in the terminal

Running tests

  • npm run test:watch - This will start the Anvil development blockchain and run the Jest tests in parallel

About

Best practices for testing React Native web3 dapps

Resources

Code of conduct

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published