Mobile web browser providing access to websites that use the Ethereum blockchain https://metamask.io
  • TypeScript 95.3%
  • JavaScript 3.9%
  • Shell 0.5%
  • HTML 0.2%
Find a file
Curtis David f7de05af7f
test: remove toMatchSnapshot and removed snapshot files in mobile platform tests (#29207)
<!--
Please submit this PR as a draft initially.

Do not mark it as "Ready for review" until this PR meets the canonical
Definition of Ready For Review in `docs/readme/ready-for-review.md`.

In short: the template must be materially complete (not just section
titles
present), all status checks must be currently passing, and the only
expected
follow-up commits must be reviewer-driven.
-->

## **Description**

> Removes `toMatchSnapshot()` usage from `MainNavigator`, `Main`,
`Root`, and `RewardsController` tests, replacing snapshots with simpler
smoke assertions (`toBeTruthy()`) or explicit `toEqual(...)` state
expectations.
> 
> Deletes the now-unused snapshot files under
`app/components/Nav/Main/__snapshots__`,
`app/components/Views/Root/__snapshots__`, and
`app/core/Engine/controllers/rewards-controller/__snapshots__`.

## **Changelog**

<!--
If this PR is not End-User-Facing and should not show up in the
CHANGELOG, you can choose to either:
1. Write `CHANGELOG entry: null`
2. Label with `no-changelog`

If this PR is End-User-Facing, please write a short User-Facing
description in the past tense like:
`CHANGELOG entry: Added a new tab for users to see their NFTs`
`CHANGELOG entry: Fixed a bug that was causing some NFTs to flicker`

(This helps the Release Engineer do their job more quickly and
accurately)
-->

CHANGELOG entry:

## **Related issues**

Fixes:

## **Manual testing steps**

```gherkin
Feature: my feature name

  Scenario: user [verb for user action]
    Given [describe expected initial app state]

    When user [verb for user action]
    Then [describe expected outcome]
```

## **Screenshots/Recordings**

<!-- If applicable, add screenshots and/or recordings to visualize the
before and after of your change. -->

### **Before**

<!-- [screenshots/recordings] -->

### **After**

<!-- [screenshots/recordings] -->

## **Pre-merge author checklist**

<!--
Every checklist item must be consciously assessed before marking this PR
as
"Ready for review". A checked box means you deliberately considered that
responsibility, not that you literally performed every action listed.

Unchecked boxes are ambiguous: they are not an implicit "N/A" and they
are not
a silent "skip". See `docs/readme/ready-for-review.md` for the full
checklist
semantics.
-->

- [ ] I've followed [MetaMask Contributor
Docs](https://github.com/MetaMask/contributor-docs) and [MetaMask Mobile
Coding
Standards](https://github.com/MetaMask/metamask-mobile/blob/main/.github/guidelines/CODING_GUIDELINES.md).
- [ ] I've completed the PR template to the best of my ability
- [ ] I've included tests if applicable
- [ ] I've documented my code using [JSDoc](https://jsdoc.app/) format
if applicable
- [ ] I've applied the right labels on the PR (see [labeling
guidelines](https://github.com/MetaMask/metamask-mobile/blob/main/.github/guidelines/LABELING_GUIDELINES.md)).
Not required for external contributors.

#### Performance checks (if applicable)

- [ ] I've tested on Android
  - Ideally on a mid-range device; emulator is acceptable
- [ ] I've tested with a power user scenario
- Use these [power-user
SRPs](https://consensyssoftware.atlassian.net/wiki/spaces/TL1/pages/edit-v2/401401446401?draftShareId=9d77e1e1-4bdc-4be1-9ebb-ccd916988d93)
to import wallets with many accounts and tokens
- [ ] I've instrumented key operations with Sentry traces for production
performance metrics
- See [`trace()`](/app/util/trace.ts) for usage and
[`addToken`](/app/components/Views/AddAsset/components/AddCustomToken/AddCustomToken.tsx#L274)
for an example

For performance guidelines and tooling, see the [Performance
Guide](https://consensyssoftware.atlassian.net/wiki/spaces/TL1/pages/400085549067/Performance+Guide+for+Engineers).

## **Pre-merge reviewer checklist**

<!--
Reviewer checklist items follow the same semantics as the author
checklist: an
unchecked box is ambiguous, a checked box means the reviewer consciously
assessed that responsibility. See `docs/readme/ready-for-review.md`.
-->

- [ ] I've manually tested the PR (e.g. pull and build branch, run the
app, test code being changed).
- [ ] I confirm that this PR addresses all acceptance criteria described
in the ticket it closes and includes the necessary testing evidence such
as recordings and or screenshots.


<!-- CURSOR_SUMMARY -->
---

> [!NOTE]
> **Low Risk**
> Low risk because changes are limited to test assertions and removal of
snapshot files; no production code paths are modified.
> 
> **Overview**
> Removes Jest snapshot-based coverage for `MainNavigator`, `Main`,
`Root`, and `RewardsController` tests, replacing it with more focused
assertions (e.g., tab bar returns `null` vs rendered, presence of key
navigation screens/components, and explicit `deriveStateFromMetadata`
`toEqual` expectations).
> 
> Deletes the corresponding snapshot files under
`app/components/Nav/Main/__snapshots__`,
`app/components/Views/Root/__snapshots__`, and
`app/core/Engine/controllers/rewards-controller/__snapshots__`.
> 
> <sup>Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit
245bd2015b. Bugbot is set up for automated
code reviews on this repo. Configure
[here](https://www.cursor.com/dashboard/bugbot).</sup>
<!-- /CURSOR_SUMMARY -->
2026-04-25 05:25:58 +00:00
.agents/skills fix(analytics): propagate key_value_pair in active ab tests (#29183) 2026-04-23 17:01:13 +00:00
.ai-pr-analyzer feat: add PR risk analysis config and hard rules (#29096) 2026-04-22 06:52:17 +00:00
.bundle chore: ensure gemfile versions (#9231) 2024-05-07 14:29:32 -07:00
.claude feat: add automated tool-usage collection via Yarn plugin and agent hooks (Phase 2) (#28815) 2026-04-21 15:38:25 +00:00
.cursor feat: add automated tool-usage collection via Yarn plugin and agent hooks (Phase 2) (#28815) 2026-04-21 15:38:25 +00:00
.github ci: add separate Runway OTA and native build workflows (phase 1) cp-7.75.0 (#29294) 2026-04-24 21:55:56 +00:00
.husky feat: remove pre push hook in favor of ci fix (#21904) 2025-10-30 12:27:45 +00:00
.storybook refactor: migrate SettingsButtonSection to design-system Button (#28058) 2026-04-08 15:34:00 +00:00
.vscode chore: adding taiwlind intellisense and linting (#17349) 2025-07-22 17:58:08 +00:00
.yarn feat: add automated tool-usage collection via Yarn plugin and agent hooks (Phase 2) (#28815) 2026-04-21 15:38:25 +00:00
android chore(release): Bump main version to 7.76.0 (#29309) 2026-04-24 13:04:00 +00:00
app test: remove toMatchSnapshot and removed snapshot files in mobile platform tests (#29207) 2026-04-25 05:25:58 +00:00
certs chore: add EAS production cert (#24220) 2026-01-06 17:38:52 +00:00
docs chore(runway): cherry-pick fix(perps): HL Unified-mode live balance — spotState ws + tradeable-balance + total-balance math cp-7.72.2 (#29270) 2026-04-23 19:23:54 +02:00
ios chore(release): Bump main version to 7.76.0 (#29309) 2026-04-24 13:04:00 +00:00
locales chore: update smart account dapp requests description copy (#29211) 2026-04-24 22:51:32 +00:00
patches chore: Update @metamask/eslint-config-typescript to v13 (#26125) 2026-03-18 16:33:25 -02:30
scripts chore: Combine Snaps build flags (#29320) 2026-04-24 16:42:04 +00:00
sourcemaps fix: Fix/8352 source map stack trace (#8509) 2024-02-01 16:45:46 -08:00
tests feat(deeplinks): add Swap, Rewards, Predict, Earn-musd, Shield, Trending to WHITELISTED_ACTIONS (#29264) 2026-04-24 16:20:46 +00:00
wdio test: add performance tests for seedless onboarding (#26753) 2026-03-30 14:10:16 +00:00
.android.env.example feat: Braze SDK integration [GE-107] cp-7.72.0 (#27881) 2026-03-31 08:39:00 +00:00
.buckconfig Inception 2018-07-17 23:35:22 -04:00
.depcheckrc.yml feat: Phase 1 - SQLite event write infrastructure for dev tools usage reporting (#28681) 2026-04-15 15:28:31 +00:00
.detoxrc.js fix(e2e): improve Detox local debug build support (#28965) 2026-04-17 10:40:27 +00:00
.e2e.env.example test: marks appwright files as deprecated and updates docs (#29109) 2026-04-23 13:56:14 +00:00
.editorconfig Standardize prettier configuration (#4182) 2022-04-29 11:42:12 -04:00
.eslintignore refactor(tests): reorganize CI tests scripts and update QA CODEOWNERS file (#29181) 2026-04-22 16:25:17 +00:00
.eslintrc.js refactor(tests): reorganize CI tests scripts and update QA CODEOWNERS file (#29181) 2026-04-22 16:25:17 +00:00
.git-blame-ignore-revs chore: add 9f9a11 to git blame ignore (#11667) 2024-10-07 21:18:19 +00:00
.gitattributes Experiment/upgrade react native 66 (#3509) 2022-01-20 09:30:56 -08:00
.gitignore chore(agentic): shrink AgentStepHud overlay and tidy agent-local gitignores (#28508) 2026-04-08 10:59:25 +00:00
.gitmodules chore: remove all remaining legacy analytics native code (#8829) 2024-03-07 18:17:38 +01:00
.ios.env.example feat: Braze SDK integration [GE-107] cp-7.72.0 (#27881) 2026-03-31 08:39:00 +00:00
.js.env.example feat: add new hardware connection screen (#28019) 2026-04-17 20:48:20 +00:00
.nvmrc feat: Add Solana account (Flask only) (#13160) 2025-01-24 20:21:05 +00:00
.prettierignore chore: remove ppom local fallback (#21474) 2025-11-04 23:57:50 +00:00
.prettierrc.js Standardize prettier configuration (#4182) 2022-04-29 11:42:12 -04:00
.ruby-version chore: update Bitrise Xcode stack to 26.2.x for iOS SDK 26 (#25136) 2026-02-27 23:04:00 +00:00
.watchmanconfig Upgrade react native to v0.58.4 (#393) 2019-02-18 10:34:59 -05:00
.yarnrc.yml chore(ci): bump xmldom & ignore uuid advisory to address ci audit failure (#29222) 2026-04-23 13:03:57 +02:00
AGENTS.md feat: add automated tool-usage collection via Yarn plugin and agent hooks (Phase 2) (#28815) 2026-04-21 15:38:25 +00:00
app.config.js chore(fonts): remove remaining Geist-Bold references (#28425) 2026-04-07 23:06:25 +00:00
architecture.svg Update Controllers to version 33.0.0 (#5200) 2022-12-13 17:28:53 -08:00
attribution.txt chore: 7.38.0 stable main sync (#13131) 2025-01-27 20:58:36 +00:00
babel.config.js chore: Update @metamask/eslint-config-typescript to v13 (#26125) 2026-03-18 16:33:25 -02:30
babel.config.tests.js feat: add transaction logic for veda depost and withdrawal (#28658) 2026-04-24 07:21:07 +00:00
bitrise.yml chore(release): Bump main version to 7.76.0 (#29309) 2026-04-24 13:04:00 +00:00
branch.json fix: disable Branch test instance and debug mode in branch.json cp-7.71.0 (#27879) 2026-03-24 20:17:07 +00:00
builds.yml chore: Combine Snaps build flags (#29320) 2026-04-24 16:42:04 +00:00
ccache.conf test: Implement CCache to e2e builds (#7975) 2023-12-20 09:55:04 +00:00
CHANGELOG.md chore(release): release-changelog/7.73.2 (#29306) 2026-04-24 09:35:14 +02:00
codecov.yml ci(code-cov): adding code-cov to project (#6789) 2023-08-16 08:45:16 -06:00
coverage-thresholds.json chore: bumping code coverage thresholds (#8478) 2024-01-30 16:15:13 -07:00
crowdin.yml fix: Crowdin Action (#14562) 2025-04-09 22:50:37 +00:00
fingerprint.config.js chore: Update @metamask/eslint-config-typescript to v13 (#26125) 2026-03-18 16:33:25 -02:30
firebase.json feat: add notifications controllers v2 - 3/7 (#10332) 2024-07-18 11:36:13 +01:00
image.png docs: Improve README.md (#8492) 2024-02-16 13:34:27 -07:00
index.js feat: replace loading animation with Rive animation (#29003) 2026-04-23 15:09:47 +00:00
jest.config.js feat: handle Braze deeplinks when clicking push notifications (#28379) 2026-04-09 06:26:14 +00:00
jest.config.view.js chore: Update @metamask/eslint-config-typescript to v13 (#26125) 2026-03-18 16:33:25 -02:30
junitProperties.js test: add custom ci properties for the test reports (#18810) 2025-08-29 20:38:18 +00:00
LICENSE Feature/add license file (#3254) 2021-10-04 14:07:42 -04:00
logo.png docs: update README branding and logo sizing (#23123) 2025-11-21 16:21:02 +00:00
metro.config.js fix: Fix UI issue related to SafeAreaView top inset recalculation cp-7.73.0 (#28622) 2026-04-10 20:46:08 -07:00
metro.transform.js chore: Combine Snaps build flags (#29320) 2026-04-24 16:42:04 +00:00
ota.config.js chore: Update @metamask/eslint-config-typescript to v13 (#26125) 2026-03-18 16:33:25 -02:30
package.json fix: prevent invalid bridge tx hashes from being persisted in txHistory (#29136) 2026-04-24 20:54:49 +00:00
react-native.config.js feat(card): Apple In-App provisioning (#25744) 2026-04-03 12:04:25 +00:00
ReactotronConfig.js feat: implement Reactotron (#17780) 2025-08-01 15:43:08 +00:00
README.md feat(devex): add yarn worktree:create and worktree:remove scripts (#27068) 2026-03-12 14:35:04 +00:00
sentry.debug.properties.example Replace Fabric Crashlytics with Sentry (#1376) 2020-03-24 12:35:57 -03:00
sentry.properties fix builds (#1597) 2020-05-26 15:03:30 -04:00
sentry.release.properties.example Replace Fabric Crashlytics with Sentry (#1376) 2020-03-24 12:35:57 -03:00
shim.js feat(perps): update latest hyperliquid sdk (#28672) 2026-04-15 11:53:46 +00:00
shimPerf.js chore: Update @metamask/eslint-config-typescript to v13 (#26125) 2026-03-18 16:33:25 -02:30
sonar-project.properties chore: exclude store migrations from SonarCloud CPD (#28292) 2026-04-01 22:59:48 +00:00
tailwind.config.js chore: Update @metamask/eslint-config-typescript to v13 (#26125) 2026-03-18 16:33:25 -02:30
tsconfig.json test: marks appwright files as deprecated and updates docs (#29109) 2026-04-23 13:56:14 +00:00
tsdoc.json docs: sample feature for tutorials (#14158) 2025-10-22 18:20:28 +00:00
wdyr.js chore: Update @metamask/eslint-config-typescript to v13 (#26125) 2026-03-18 16:33:25 -02:30
yarn.lock fix: prevent invalid bridge tx hashes from being persisted in txHistory (#29136) 2026-04-24 20:54:49 +00:00

MetaMask logo

MetaMask Mobile

CI CLA

MetaMask is a mobile wallet that provides easy access to websites that use the Ethereum blockchain.

For up to the minute news, follow our Twitter or Medium pages.

To learn how to develop MetaMask-compatible applications, visit our Developer Docs.

To learn how to contribute to the MetaMask codebase, visit our Contributor Docs.

Documentation

Getting started

Infura Project Setup

MetaMask Mobile requires an Infura project ID to connect to blockchain networks.

Internal Contributors

  1. Grab the .js.env file from 1Password, ask around for the correct vault. This file contains the MM_INFURA_PROJECT_ID.

External Contributors

  1. Go to https://developer.metamask.io and create an account
  2. Generate an API key
  3. Add API key to MM_INFURA_PROJECT_ID in .js.env.example
  4. Rename .js.env.example to .js.env
  5. Rebuild the app

[!CAUTION]

Without an Infura project ID, the app cannot connect to blockchain networks.

Expo is the fastest way to start developing. With the Expo framework, developers don't need to compile the native side of the application as before, hence no need for any native environment setup, developers only need to download a precompiled development build and run the javascript bundler. The development build will then connect with the bundler to load the javascript code.

Expo Environment Setup

Install node, yarn v4 and watchman.

Clone the project

git clone git@github.com:MetaMask/metamask-mobile.git && \
cd metamask-mobile

Install dependencies

yarn setup:expo

Run the bundler

yarn watch

Download and install the development build

  • Expo development builds are hosted in Runway buckets and are made available to all contributors through the public bucket links below. A new build is generated every time a PR is merged into the main branch.

  • For Android:

    • Download and install an .apk file from this Runway bucket onto your Android device or emulator.
  • For iOS:

    • Physical device
      • Your test device needs to first be registered with our Apple developer account.
      • Once registered, download and install an .ipa file from this Runway bucket onto your device.
    • Simulator
      • Download and install an .app file from this Runway bucket onto your simulator.
      • Note: Our .app files are zipped and hosted under Additional Artifacts in the bucket. Since this hosting additional artifacts in public buckets is a relatively new feature, contributors may find that some builds are missing additional artifacts. Under the hood, these are usually associated with failed or aborted Bitrise builds. We are working with the Runway team to better filter out these builds and are subject to change in the future.

Load the app

If on a simulator:

  • use the initial expo screen that appears when starting the development to choose the bundler url
  • OR press "a" for Android or "i" for iOS on the terminal where the bundler is running

If on a physical device:

  • Use the camera app to scan the QR code presented by the bundler running on the terminal

That's it! This will work for any javascript development, if you need to develop or modify native code please see the next section.

Native Development

If developing or modifying native code or installing any library that introduces or uses native code, it is not possible to use an Expo precompiled development build as you need to compile the native side of the application again. To do so, please follow the steps stated in this section.

Native Environment setup

Before running the app for native development, make sure your development environment has all the required tools. Several of these tools (ie Node and Ruby) may require specific versions in order to successfully build the app.

Setup your development environment

Building the app

Clone the project

git clone git@github.com:MetaMask/metamask-mobile.git && \
cd metamask-mobile
Firebase Messaging Setup

MetaMask uses Firebase Cloud Messaging (FCM) to enable app communications. To integrate FCM, you'll need configuration files for both iOS and Android platforms.

Internal Contributor instructions
  1. Grab the .js.env file from 1Password, ask around for the correct vault. This file contains the GOOGLE_SERVICES_B64_ANDROID and GOOGLE_SERVICES_B64_IOS secrets that will be used to generate the relevant configuration files for IOS/Android.
  2. Install and run & start the application as documented below.
External Contributor instructions

As an external contributor, you need to provide your own Firebase project configuration files:

  • GoogleService-Info.plist (iOS)
  • google-services.json (Android)
  1. Create a Free Firebase Project
    • Set up a Firebase project in the Firebase Console.
    • Configure the project with a client package name matching io.metamask (IMPORTANT).
  2. Add Configuration Files
    • Create/Update the google-services.json and GoogleService-Info.plist files in:
    • android/app/google-services.json (for Android)
    • ios/GoogleServices/GoogleService-Info.plist directory (for iOS)
  3. Create the correct base64 environments variables.
# Generate Android Base64 Version of Google Services
export GOOGLE_SERVICES_B64_ANDROID="$(base64 -w0 -i ./android/app/google-services.json)" && echo "export GOOGLE_SERVICES_B64_ANDROID=\"$GOOGLE_SERVICES_B64_ANDROID\"" | tee -a .js.env

# Generate IOS Base64 Version of Google Services
export GOOGLE_SERVICES_B64_IOS="$(base64 -w0 -i ./ios/GoogleServices/GoogleService-Info.plist)" && echo "export GOOGLE_SERVICES_B64_IOS=\"$GOOGLE_SERVICES_B64_IOS\"" | tee -a .js.env

[!CAUTION]

In case you don't provide your own Firebase project config file or run the steps above, you will face the error No matching client found for package name 'io.metamask'.

In case of any doubt, please follow the instructions in the link below to get your Firebase project config file. Firebase Project Quickstart

Install dependencies
yarn setup

Not the usual install command, this will run scripts and a lengthy postinstall flow

Running the app for native development

Run Metro bundler

yarn watch

Like a local server for the app

Run on a iOS device

yarn start:ios

Run on an Android device

yarn start:android

Development Tools

Git Hooks (Husky)

This project uses Husky to run pre-commit hooks that automatically format and lint your code before commits. The pre-commit hook runs lint-staged which executes:

  • Prettier - Code formatting for *.{js,jsx,ts,tsx,json,feature} files
  • ESLint - Linting and auto-fixing for *.{js,jsx,ts,tsx} files

Disabling Husky Locally

If you need to disable Husky pre-commit hooks temporarily (e.g., for emergency commits or debugging), you have several options:

Option 1: Skip hooks for a single commit
git commit --no-verify -m "your commit message"
Option 2: Bypass hooks with environment variable
# Disable for current session
export HUSKY=0
git commit -m "your commit message"

# Or disable for a single command
HUSKY=0 git commit -m "your commit message"

Note: While these methods allow you to bypass the pre-commit hooks, remember that the CI/CD pipeline will still run linting checks. It's recommended to fix linting issues before pushing your changes to avoid build failures.