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 Swaps test from mocha to jest #25297

Merged
merged 6 commits into from
Jun 19, 2024

Conversation

itsyoboieltr
Copy link
Contributor

@itsyoboieltr itsyoboieltr commented Jun 13, 2024

Description

Open in GitHub Codespaces

This PR converts app/scripts/controllers/swaps.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/swaps.test.js in the testMatch array. The .mocharc.js was updated to ignore the test.

Related issues

Fixes: #19355

Manual testing steps

  1. Running yarn jest -- app/scripts/controllers/swaps.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.

@itsyoboieltr itsyoboieltr requested a review from a team as a code owner June 13, 2024 14:28
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.

Copy link

codecov bot commented Jun 14, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 64.92%. Comparing base (c306f20) to head (b7ca93e).
Report is 3 commits behind head on develop.

Additional details and impacted files
@@             Coverage Diff             @@
##           develop   #25297      +/-   ##
===========================================
- Coverage    65.40%   64.92%   -0.47%     
===========================================
  Files         1382     1382              
  Lines        54736    54736              
  Branches     14353    14353              
===========================================
- Hits         35795    35537     -258     
- Misses       18941    19199     +258     

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

@metamaskbot
Copy link
Collaborator

Builds ready [b7ca93e]
Page Load Metrics (957 ± 681 ms)
PlatformPageMetricMin (ms)Max (ms)Average (ms)StandardDeviation (ms)MarginOfError (ms)
ChromeHomefirstPaint622211284924
domContentLoaded85923147
load4040579571417681
domInteractive85923147
Bundle size diffs
  • background: 0 Bytes (0.00%)
  • ui: 0 Bytes (0.00%)
  • common: 0 Bytes (0.00%)

Copy link
Contributor

@danjm danjm left a comment

Choose a reason for hiding this comment

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

LGTM

@DDDDDanica
Copy link
Contributor

LGTM !

@DDDDDanica DDDDDanica merged commit f5a3437 into develop Jun 19, 2024
74 checks passed
@DDDDDanica DDDDDanica deleted the swaps-tests-mocha-to-jest branch June 19, 2024 15:01
@github-actions github-actions bot locked and limited conversation to collaborators Jun 19, 2024
@metamaskbot metamaskbot added the release-12.1.0 Issue or pull request that will be included in release 12.1.0 label Jun 19, 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