Skip to content

Conversation

@jiexi
Copy link
Contributor

@jiexi jiexi commented Sep 2, 2023

Explanation

There is currently a fitness CI job that enforces the usage of assert/sinon does not increase. This PR migrates MetaMaskController from mocha to jest to resolve the fitness CI job failing for another branch. It achieves this by replacing usage of assert with jest expect and sinon with jest stubs.

Screenshots/Screencaps

Before

After

Manual Testing Steps

yarn test:unit:jest

Pre-merge author checklist

  • I've clearly explained:
    • What problem this PR is solving
    • How this problem was solved
    • How reviewers can test my changes
  • Sufficient automated test coverage has been added

Pre-merge reviewer checklist

  • Manual testing (e.g. pull and build branch, run in browser, test code being changed)
  • PR is linked to the appropriate GitHub issue
  • [] IF this PR fixes a bug in the release milestone, add this PR to the release milestone

If further QA is required (e.g. new feature, complex testing steps, large refactor), add the Extension QA Board label.

In this case, a QA Engineer approval will be be required.

@jiexi jiexi requested a review from a team as a code owner September 2, 2023 00:25
@github-actions
Copy link
Contributor

github-actions bot commented Sep 2, 2023

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.

@jiexi jiexi added the team-wallet-api-platform-deprecated DEPRECATED: please use "team-wallet-integrations" instead label Sep 2, 2023
@codecov
Copy link

codecov bot commented Sep 5, 2023

Codecov Report

Patch coverage: 62.50% and project coverage change: -0.67% ⚠️

Comparison is base (ac810ce) 68.87% compared to head (3e95edd) 68.20%.
Report is 1 commits behind head on develop.

Additional details and impacted files
@@             Coverage Diff             @@
##           develop   #20696      +/-   ##
===========================================
- Coverage    68.87%   68.20%   -0.67%     
===========================================
  Files          999      999              
  Lines        38978    39846     +868     
  Branches     10473    10669     +196     
===========================================
+ Hits         26845    27174     +329     
- Misses       12133    12672     +539     
Files Changed Coverage Δ
.mocharc.js 100.00% <ø> (ø)
app/scripts/metamask-controller.js 54.36% <ø> (-11.03%) ⬇️
app/scripts/controllers/app-state.js 38.81% <50.00%> (-1.04%) ⬇️
app/scripts/controllers/metametrics.js 79.80% <75.00%> (ø)

... and 20 files with indirect coverage changes

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@metamaskbot
Copy link
Collaborator

Builds ready [afa9102]
Page Load Metrics (1539 ± 37 ms)
PlatformPageMetricMin (ms)Max (ms)Average (ms)StandardDeviation (ms)MarginOfError (ms)
ChromeHomefirstPaint107156127126
domContentLoaded1381166415397737
load1381166415397737
domInteractive1381166415397737
Bundle size diffs [🚨 Warning! Bundle size has increased!]
  • background: 110 Bytes (0.00%)
  • ui: 0 Bytes (0.00%)
  • common: 0 Bytes (0.00%)

@metamaskbot
Copy link
Collaborator

Builds ready [d2e5b5a]
Page Load Metrics (1825 ± 101 ms)
PlatformPageMetricMin (ms)Max (ms)Average (ms)StandardDeviation (ms)MarginOfError (ms)
ChromeHomefirstPaint1112331583215
domContentLoaded156222891824210101
load156222891825211101
domInteractive156222891824211101
Bundle size diffs [🚨 Warning! Bundle size has increased!]
  • background: 110 Bytes (0.00%)
  • ui: 0 Bytes (0.00%)
  • common: 0 Bytes (0.00%)

@jiexi jiexi requested a review from Gudahtt September 6, 2023 23:24
@jiexi jiexi mentioned this pull request Sep 7, 2023
8 tasks
@metamaskbot
Copy link
Collaborator

Builds ready [eb22439]
Page Load Metrics (1628 ± 85 ms)
PlatformPageMetricMin (ms)Max (ms)Average (ms)StandardDeviation (ms)MarginOfError (ms)
ChromeHomefirstPaint111164134157
domContentLoaded14572199162817685
load14572200162817685
domInteractive14572199162817685
Bundle size diffs [🚨 Warning! Bundle size has increased!]
  • background: 110 Bytes (0.00%)
  • ui: 0 Bytes (0.00%)
  • common: 0 Bytes (0.00%)

Co-authored-by: Alex Donesky <adonesky@gmail.com>
@metamaskbot
Copy link
Collaborator

Builds ready [3e95edd]
Page Load Metrics (1555 ± 83 ms)
PlatformPageMetricMin (ms)Max (ms)Average (ms)StandardDeviation (ms)MarginOfError (ms)
ChromeHomefirstPaint100184134199
domContentLoaded13762188155417283
load13762188155517283
domInteractive13762188155417283
Bundle size diffs [🚨 Warning! Bundle size has increased!]
  • background: 110 Bytes (0.00%)
  • ui: 0 Bytes (0.00%)
  • common: 0 Bytes (0.00%)

Copy link
Contributor

@adonesky1 adonesky1 left a comment

Choose a reason for hiding this comment

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

LGTM!

Copy link
Contributor

@adonesky1 adonesky1 left a comment

Choose a reason for hiding this comment

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

LGTM!

@jiexi jiexi merged commit 37824db into develop Sep 11, 2023
@jiexi jiexi deleted the jl/migrate-assert-sinon branch September 11, 2023 21:28
@github-actions github-actions bot locked and limited conversation to collaborators Sep 11, 2023
@metamaskbot metamaskbot added the release-11.2.0 Issue or pull request that will be included in release 11.2.0 label Sep 11, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

release-11.2.0 Issue or pull request that will be included in release 11.2.0 team-wallet-api-platform-deprecated DEPRECATED: please use "team-wallet-integrations" instead

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants