Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Convert MetaMetricsController tests from mocha to jest #25210

Merged
merged 5 commits into from
Jun 14, 2024

Conversation

itsyoboieltr
Copy link
Contributor

@itsyoboieltr itsyoboieltr commented Jun 11, 2024

Description

Open in GitHub Codespaces

This PR converts app/scripts/controllers/metametrics.test.js from mocha to jest. In particular, replaces instances of assert with expect, and removes sinon and uses jest's mocking capabilities in its place. The jest.config.js was updated to include app/scripts/controllers/metametrics.test.js in the testMatch array. The .mocharc.js was updated to ignore the test.

Related issues

Fixes: #19355, #25092

Manual testing steps

  1. Running yarn jest -- app/scripts/controllers/metametrics.test.js and seeing all tests pass
  2. Running yarn test:unit:mocha and not seeing the metametrics tests run.

Screenshots/Recordings

Not applicable

Pre-merge author checklist

Pre-merge reviewer checklist

  • 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.

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.

@itsyoboieltr itsyoboieltr marked this pull request as draft June 11, 2024 10:24
@itsyoboieltr itsyoboieltr marked this pull request as ready for review June 11, 2024 11:52
@metamaskbot
Copy link
Collaborator

Builds ready [1ac0f11]
Page Load Metrics (45 ± 5 ms)
PlatformPageMetricMin (ms)Max (ms)Average (ms)StandardDeviation (ms)MarginOfError (ms)
ChromeHomefirstPaint6011275115
domContentLoaded8471184
load408945105
domInteractive8471184
Bundle size diffs
  • background: 0 Bytes (0.00%)
  • ui: 0 Bytes (0.00%)
  • common: 0 Bytes (0.00%)

Copy link

codecov bot commented Jun 11, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 65.38%. Comparing base (6eee01a) to head (3154644).

Additional details and impacted files
@@             Coverage Diff             @@
##           develop   #25210      +/-   ##
===========================================
- Coverage    65.69%   65.38%   -0.31%     
===========================================
  Files         1377     1377              
  Lines        54624    54624              
  Branches     14317    14317              
===========================================
- Hits         35882    35712     -170     
- Misses       18742    18912     +170     

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

@itsyoboieltr itsyoboieltr force-pushed the metametrics-tests-mocha-to-jest branch from 1ac0f11 to b2d847b Compare June 11, 2024 14:03
@metamaskbot
Copy link
Collaborator

Builds ready [3154644]
Page Load Metrics (47 ± 11 ms)
PlatformPageMetricMin (ms)Max (ms)Average (ms)StandardDeviation (ms)MarginOfError (ms)
ChromeHomefirstPaint61229823517
domContentLoaded8231032
load37148472311
domInteractive8231032
Bundle size diffs
  • background: 0 Bytes (0.00%)
  • ui: 0 Bytes (0.00%)
  • common: 0 Bytes (0.00%)

@itsyoboieltr itsyoboieltr merged commit 2aaf565 into develop Jun 14, 2024
77 checks passed
@itsyoboieltr itsyoboieltr deleted the metametrics-tests-mocha-to-jest branch June 14, 2024 18:16
@github-actions github-actions bot locked and limited conversation to collaborators Jun 14, 2024
@metamaskbot metamaskbot added the release-12.1.0 Issue or pull request that will be included in release 12.1.0 label Jun 14, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
release-12.1.0 Issue or pull request that will be included in release 12.1.0 team-extension-platform
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Finishing mocha tests transition
4 participants