Skip to content

test: split TypeScript configs for Jest unit and E2E typing#40500

Open
davidmurdoch wants to merge 6 commits intomainfrom
chore/split-tsconfig-jest-mocha
Open

test: split TypeScript configs for Jest unit and E2E typing#40500
davidmurdoch wants to merge 6 commits intomainfrom
chore/split-tsconfig-jest-mocha

Conversation

@davidmurdoch
Copy link
Contributor

@davidmurdoch davidmurdoch commented Feb 27, 2026

Description

  • Split TypeScript typechecking into two configs so Jest unit tests and E2E/Mocha tests can use different global typings.
  • Added tsconfig.unit.json for app/unit typing and tsconfig.e2e.json for test/e2e typing.
  • Updated lint:tsc to run both configs.
  • Removed stale @ts-expect-error directives and adjusted affected parameterized test typings so both configs pass.
  • Follow-up fix: restored default expectedState = {} in ui/hooks/bridge/useBridging.test.ts after the callback refactor, which fixed the failing unit shard in CI.
  • Follow-up fix: gave each split tsconfig its own tsBuildInfoFile to avoid incremental cache collisions.

Changelog

CHANGELOG entry: null

Related issues

  • None.

Manual testing steps

  1. Run yarn lint:changed:fix.
  2. Run yarn lint:tsc.
  3. Run yarn test:unit ui/hooks/bridge/useBridging.test.ts --runInBand.
  4. Verify check-template-and-add-labels passes in CI.

Screenshots/Recordings

  • N/A (non-UI change).

Pre-merge author checklist

  • Followed MetaMask contributor and coding guidelines.
  • Added/updated tests where relevant.
  • Ran relevant lint/typecheck/tests locally.
  • Added changelog entry (CHANGELOG entry: null).

Pre-merge reviewer checklist

  • Confirm split tsconfigs are scoped correctly (test/e2e only in e2e config).
  • Confirm unit tests pass on CI shard previously failing (ui/hooks/bridge/useBridging.test.ts).
  • Confirm no runtime behavior changes (test/config-only).

Note

Low Risk
Low risk: config/typechecking-only changes that mainly affect lint/typecheck and test compilation, with no production runtime logic modified.

Overview
Splits TypeScript typechecking into separate composite projects (tsconfig.source.json, tsconfig.unit.json, tsconfig.e2e.json) built via tsc -b, factoring shared options into a new tsconfig.base.json and giving each project its own incremental cache file.

Updates ESLint’s TypeScript override to run per-project (using each tsconfig’s file list and parserOptions.project) so Jest unit tests and Mocha/E2E tests get the correct global typings.

Cleans up test files to typecheck under the split configs by removing stale @ts-expect-error suppressions and loosening/adjusting parameter typings in various it.each/describe.each cases, and updates the TS migration dashboard’s madge config to use tsconfig.base.json.

Written by Cursor Bugbot for commit 971798a. This will update automatically on new commits. Configure here.

@github-actions
Copy link
Contributor

CLA Signature Action: All authors have signed the CLA. You may need to manually re-run the blocking PR check if it doesn't pass in a few minutes.

@metamaskbot metamaskbot added the team-extension-platform Extension Platform team label Feb 27, 2026
@metamaskbotv2
Copy link
Contributor

metamaskbotv2 bot commented Feb 27, 2026

✨ Files requiring CODEOWNER review ✨

🔑 @MetaMask/accounts-engineers (2 files, +0 -6)
  • 📁 app/
    • 📁 scripts/
      • 📁 lib/
        • 📁 snap-keyring/
          • 📁 utils/
            • 📄 isBlockedUrl.test.ts +0 -1
            • 📄 keyring-snaps-permissions.test.ts +0 -5

@MetaMask/confirmations (1 files, +0 -1)
  • 📁 app/
    • 📁 scripts/
      • 📁 lib/
        • 📁 ppom/
          • 📄 ppom-util.test.ts +0 -1

💸 @MetaMask/transactions (1 files, +0 -1)
  • 📁 app/
    • 📁 scripts/
      • 📁 lib/
        • 📁 smart-transaction/
          • 📄 smart-transactions.test.ts +0 -1

👨‍🔧 @MetaMask/wallet-integrations (3 files, +0 -4)
  • 📁 app/
    • 📁 scripts/
      • 📁 lib/
        • 📁 rpc-method-middleware/
          • 📁 handlers/
            • 📄 ethereum-chain-utils.test.ts +0 -1
            • 📄 wallet-revokePermissions.test.ts +0 -1
            • 📄 createUnsupportedMethodMiddleware.test.ts +0 -2

@davidmurdoch davidmurdoch changed the title Split TypeScript configs for Jest unit and E2E typing test: split TypeScript configs for Jest unit and E2E typing Feb 27, 2026
Copy link

@cursor cursor bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, have a team admin enable autofix in the Cursor dashboard.

@metamaskbotv2
Copy link
Contributor

metamaskbotv2 bot commented Feb 27, 2026

Builds ready [c731d87]
⚡ Performance Benchmarks
👆 Interaction Benchmarks
BenchmarkMetricMean (ms)Min (ms)Max (ms)Std Dev (ms)P75 (ms)P95 (ms)
Load New Accountload_new_account30127135935322359
total30127135935322359
Confirm Txconfirm_tx607660706081460776081
total607660706081460776081
Bridge User Actionsbridge_load_page25723629122263291
bridge_load_asset_picker19217921313192213
bridge_search_token72270176123715761
total1147110812164111321216
🔌 Startup Benchmarks
BenchmarkMetricMean (ms)Min (ms)Max (ms)Std Dev (ms)P75 (ms)P95 (ms)
Standard HomeuiStartup14271221187011814651638
load11981018163610212331387
domContentLoaded118999015699812201376
domInteractive3017125212685
firstPaint1627046684214342
backgroundConnect21419443626216245
firstReactRender19124652028
initialActions106123
loadScripts99380113629510291184
setupStore1463851722
numNetworkReqs312295202286
Power User HomeuiStartup2648143610422162729995015
load11821013180217112081629
domContentLoaded11671003178916511971562
domInteractive37171653133119
firstPaint248731796267262472
backgroundConnect78325146709017352531
firstReactRender22154052433
initialActions104112
loadScripts96780515541589971367
setupStore1353141519
numNetworkReqs78421572791138
🧭 User Journey Benchmarks
BenchmarkMetricMean (ms)Min (ms)Max (ms)Std Dev (ms)P75 (ms)P95 (ms)
Onboarding Import WalletimportWalletToSocialScreen2202192221221222
srpButtonToSrpForm96939829798
confirmSrpToPwForm22222302323
pwFormToMetricsScreen16151701617
metricsToWalletReadyScreen17171701717
doneButtonToHomeScreen1108604142930012921429
openAccountMenuToAccountListLoaded74137032788131976927881
total88968681903912690029039
Onboarding New WalletcreateWalletToSocialScreen2172162181217218
srpButtonToPwForm1081061112108111
createPwToRecoveryScreen889099
skipBackupToMetricsScreen37344023740
agreeButtonToOnboardingSuccess16161701617
doneButtonToAssetList856467160044411291600
total1246855198644215191986
Asset DetailsassetClickToPriceChart38364123641
total38364123641
Solana Asset DetailsassetClickToPriceChart47455124651
total47455124651
Import Srp HomeloginToHomeScreen23222118270121223912701
openAccountMenuAfterLogin48474914949
homeAfterImportWithNewWallet2826268929178828882917
total49954829510610550565106
Send TransactionsopenSendPageFromHome30193883738
selectTokenToSendFormLoaded21202212122
reviewTransactionToConfirmationPage8648568758869875
total9179119297915929
SwapopenSwapPageFromHome12510314514131145
fetchAndDisplaySwapQuotes55724565623180062236231
total56974691637779863416377
🌐 Dapp Page Load Benchmarks

Current Commit: c731d87 | Date: 2/27/2026

📄 Localhost MetaMask Test Dapp

Samples: 100

Summary

  • pageLoadTime-> current mean value: 1.05s (±40ms) 🟡 | historical mean value: 1.04s ⬆️ (historical data)
  • domContentLoaded-> current mean value: 739ms (±37ms) 🟢 | historical mean value: 731ms ⬆️ (historical data)
  • firstContentfulPaint-> current mean value: 83ms (±12ms) 🟢 | historical mean value: 82ms ⬆️ (historical data)

📈 Detailed Results

Metric Mean Std Dev Min Max P95 P99
pageLoadTime 1.05s 40ms 1.02s 1.34s 1.09s 1.34s
domContentLoaded 739ms 37ms 708ms 1.01s 765ms 1.01s
firstPaint 83ms 12ms 64ms 184ms 92ms 184ms
firstContentfulPaint 83ms 12ms 64ms 184ms 92ms 184ms
largestContentfulPaint 0ms 0ms 0ms 0ms 0ms 0ms
Bundle size diffs [🚀 Bundle size reduced!]
  • background: 426 Bytes (0.01%)
  • ui: -15.35 KiB (-0.18%)
  • common: -86 Bytes (0%)

@metamaskbot metamaskbot added INVALID-PR-TEMPLATE PR's body doesn't match template and removed INVALID-PR-TEMPLATE PR's body doesn't match template labels Feb 27, 2026
@metamaskbotv2
Copy link
Contributor

metamaskbotv2 bot commented Feb 27, 2026

Builds ready [fc0495e]
⚡ Performance Benchmarks
👆 Interaction Benchmarks
BenchmarkMetricMean (ms)Min (ms)Max (ms)Std Dev (ms)P75 (ms)P95 (ms)
Load New Accountload_new_account2722622827278282
total2722622827278282
Confirm Txconfirm_tx605160436058660586058
total605160436058660586058
Bridge User Actionsbridge_load_page2112042195213219
bridge_load_asset_picker2021872139205213
bridge_search_token7026977105704710
total112511121136911271136
🔌 Startup Benchmarks
BenchmarkMetricMean (ms)Min (ms)Max (ms)Std Dev (ms)P75 (ms)P95 (ms)
Standard HomeuiStartup14181193183711014561637
load1197100515489812281388
domContentLoaded118997915389412171381
domInteractive2917150222580
firstPaint1467248988193335
backgroundConnect21219529616214238
firstReactRender20144562132
initialActions209224
loadScripts99479513439410251186
setupStore1364671524
numNetworkReqs312292192286
Power User HomeuiStartup34251588115792531407310498
load12681068167711712991516
domContentLoaded12471058166410912821448
domInteractive3420133213157
firstPaint209891466152256351
backgroundConnect15932659986240320618056
firstReactRender26166292947
initialActions1010114
loadScripts1030856144510810661237
setupStore1555271726
numNetworkReqs83441462197119
🧭 User Journey Benchmarks
BenchmarkMetricMean (ms)Min (ms)Max (ms)Std Dev (ms)P75 (ms)P95 (ms)
Onboarding Import WalletimportWalletToSocialScreen2202172232221223
srpButtonToSrpForm98969919899
confirmSrpToPwForm23232302323
pwFormToMetricsScreen16161701717
metricsToWalletReadyScreen17161811818
doneButtonToHomeScreen1001645142930912891429
openAccountMenuToAccountListLoaded75097032789233678447892
total8888883889403589108940
Onboarding New WalletcreateWalletToSocialScreen2172152181218218
srpButtonToPwForm1051021072107107
createPwToRecoveryScreen888088
skipBackupToMetricsScreen36353713737
agreeButtonToOnboardingSuccess16161711617
doneButtonToAssetList57049262045607620
total9759431009279921009
Asset DetailsassetClickToPriceChart593587228587
total593587228587
Solana Asset DetailsassetClickToPriceChart54486266162
total54486266162
Import Srp HomeloginToHomeScreen1978196120061919852006
openAccountMenuAfterLogin42394424344
homeAfterImportWithNewWallet2136209321803421562180
total4192415742333042074233
Send TransactionsopenSendPageFromHome39364124041
selectTokenToSendFormLoaded20182212122
reviewTransactionToConfirmationPage8488468502850850
total9079059081907908
SwapopenSwapPageFromHome1073115443136154
fetchAndDisplaySwapQuotes4639457247468147324746
total4708466547633647114763
🌐 Dapp Page Load Benchmarks

Current Commit: fc0495e | Date: 2/27/2026

📄 Localhost MetaMask Test Dapp

Samples: 100

Summary

  • pageLoadTime-> current mean value: 1.04s (±48ms) 🟡 | historical mean value: 1.05s ⬇️ (historical data)
  • domContentLoaded-> current mean value: 728ms (±44ms) 🟢 | historical mean value: 740ms ⬇️ (historical data)
  • firstContentfulPaint-> current mean value: 80ms (±12ms) 🟢 | historical mean value: 83ms ⬇️ (historical data)

📈 Detailed Results

Metric Mean Std Dev Min Max P95 P99
pageLoadTime 1.04s 48ms 1.01s 1.38s 1.06s 1.38s
domContentLoaded 728ms 44ms 705ms 1.05s 749ms 1.05s
firstPaint 80ms 12ms 64ms 184ms 88ms 184ms
firstContentfulPaint 80ms 12ms 64ms 184ms 88ms 184ms
largestContentfulPaint 0ms 0ms 0ms 0ms 0ms 0ms
Bundle size diffs [🚨 Warning! Bundle size has increased!]
  • background: 426 Bytes (0.01%)
  • ui: -14.7 KiB (-0.18%)
  • common: 3.03 KiB (0.03%)

@sonarqubecloud
Copy link

@metamaskbotv2
Copy link
Contributor

metamaskbotv2 bot commented Feb 27, 2026

Builds ready [6d5dfc0]
⚡ Performance Benchmarks
👆 Interaction Benchmarks
BenchmarkMetricMean (ms)Min (ms)Max (ms)Std Dev (ms)P75 (ms)P95 (ms)
Load New Accountload_new_account28427030314298303
total28427030314298303
Confirm Txconfirm_tx6043602460581260456058
total6043602460581260456058
Bridge User Actionsbridge_load_page22618727432254274
bridge_load_asset_picker22216329847252298
bridge_search_token70969972610706726
total1168108912987912201298
🔌 Startup Benchmarks
BenchmarkMetricMean (ms)Min (ms)Max (ms)Std Dev (ms)P75 (ms)P95 (ms)
Standard HomeuiStartup14231197184911014771610
load1192101214969212211363
domContentLoaded1185100414909112161342
domInteractive2918116212484
firstPaint1487140474194271
backgroundConnect21419531617217236
firstReactRender20144462234
initialActions109224
loadScripts98880312828910171149
setupStore157172171519
numNetworkReqs312297192283
Power User HomeuiStartup2136142010061113520994286
load11731018169514911921533
domContentLoaded11551012162314111691496
domInteractive3418141223392
firstPaint1967839186264344
backgroundConnect50125038816433201642
firstReactRender23155872534
initialActions105113
loadScripts94582313951379581301
setupStore1665271826
numNetworkReqs67341572777124
🧭 User Journey Benchmarks
BenchmarkMetricMean (ms)Min (ms)Max (ms)Std Dev (ms)P75 (ms)P95 (ms)
Onboarding Import WalletimportWalletToSocialScreen2212212210221221
srpButtonToSrpForm97901025101102
confirmSrpToPwForm21212202122
pwFormToMetricsScreen15151501515
metricsToWalletReadyScreen15151711617
doneButtonToHomeScreen68758580795754807
openAccountMenuToAccountListLoaded77987640803115878568031
total88838629899914389868999
Onboarding New WalletcreateWalletToSocialScreen2202202200220220
srpButtonToPwForm1091091101110110
createPwToRecoveryScreen889089
skipBackupToMetricsScreen37353813838
agreeButtonToOnboardingSuccess16151711717
doneButtonToAssetList71948012172788201217
total1117873160527812441605
Asset DetailsassetClickToPriceChart46385685256
total46385685256
Solana Asset DetailsassetClickToPriceChart57526035960
total57526035960
Import Srp HomeloginToHomeScreen1918188019562819281956
openAccountMenuAfterLogin41384534245
homeAfterImportWithNewWallet2175213922394021772239
total42874064450918044844509
Send TransactionsopenSendPageFromHome18181801818
selectTokenToSendFormLoaded20192112121
reviewTransactionToConfirmationPage8598508759863875
total90288991511912915
SwapopenSwapPageFromHome1139712410124124
fetchAndDisplaySwapQuotes4634460546802946374680
total4747471148033847604803
🌐 Dapp Page Load Benchmarks

Current Commit: 6d5dfc0 | Date: 2/27/2026

📄 Localhost MetaMask Test Dapp

Samples: 100

Summary

  • pageLoadTime-> current mean value: 1.03s (±39ms) 🟡 | historical mean value: 1.05s ⬇️ (historical data)
  • domContentLoaded-> current mean value: 727ms (±37ms) 🟢 | historical mean value: 740ms ⬇️ (historical data)
  • firstContentfulPaint-> current mean value: 79ms (±12ms) 🟢 | historical mean value: 83ms ⬇️ (historical data)

📈 Detailed Results

Metric Mean Std Dev Min Max P95 P99
pageLoadTime 1.03s 39ms 1.01s 1.34s 1.06s 1.34s
domContentLoaded 727ms 37ms 702ms 1.01s 745ms 1.01s
firstPaint 79ms 12ms 64ms 184ms 88ms 184ms
firstContentfulPaint 79ms 12ms 64ms 184ms 88ms 184ms
largestContentfulPaint 0ms 0ms 0ms 0ms 0ms 0ms
Bundle size diffs
  • background: 58 Bytes (0%)
  • ui: 5 Bytes (0%)
  • common: 70 Bytes (0%)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size-L team-extension-platform Extension Platform team

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants