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: migrate global unit tests from Mocha to Jest #26104

Merged
merged 8 commits into from
Jul 29, 2024

Conversation

itsyoboieltr
Copy link
Contributor

@itsyoboieltr itsyoboieltr commented Jul 24, 2024

Description

Open in GitHub Codespaces

This PR converts the global unit tests from Mocha to Jest. It removes the test-unit-global CircleCI pipeline and runs the global unit tests on GitHub actions along with the normal unit tests, contributing to the coverage report.

Upon discussion with @Gudahtt the ignored dysfunctional unit test test/unit-global/protect-intrinsics.test.js which was not compatible with the Jest environment will be re-introduced in a separate PR. The test will be ported to run as part of the e2e test suite, as the browser would be a better test environment, closer to production.

Related issues

Fixes: #25496

Manual testing steps

  1. Tests should be in Jest syntax, and should still pass
  2. Tests should run on GitHub actions with normal unit tests, not on CircleCI

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 self-assigned this Jul 24, 2024
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
Copy link
Collaborator

Builds ready [e6eea7c]
Page Load Metrics (336 ± 299 ms)
PlatformPageMetricMin (ms)Max (ms)Average (ms)StandardDeviation (ms)MarginOfError (ms)
ChromeHomefirstPaint732531093818
domContentLoaded10123292311
load411882336622299
domInteractive10123282311
Bundle size diffs
  • background: 0 Bytes (0.00%)
  • ui: 0 Bytes (0.00%)
  • common: 0 Bytes (0.00%)

Copy link

@itsyoboieltr itsyoboieltr marked this pull request as ready for review July 25, 2024 15:32
@itsyoboieltr itsyoboieltr requested review from kumavis and a team as code owners July 25, 2024 15:32
Copy link

codecov bot commented Jul 25, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 69.94%. Comparing base (51410b2) to head (060d93c).
Report is 5 commits behind head on develop.

Additional details and impacted files
@@           Coverage Diff            @@
##           develop   #26104   +/-   ##
========================================
  Coverage    69.94%   69.94%           
========================================
  Files         1409     1409           
  Lines        49795    49795           
  Branches     13773    13773           
========================================
  Hits         34826    34826           
  Misses       14969    14969           

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

@metamaskbot
Copy link
Collaborator

Builds ready [060d93c]
Page Load Metrics (224 ± 228 ms)
PlatformPageMetricMin (ms)Max (ms)Average (ms)StandardDeviation (ms)MarginOfError (ms)
ChromeHomefirstPaint59171962713
domContentLoaded96925168
load451730224474228
domInteractive96825168
Bundle size diffs
  • background: 0 Bytes (0.00%)
  • ui: 0 Bytes (0.00%)
  • common: 0 Bytes (0.00%)

@DDDDDanica
Copy link
Contributor

LGTM !

@itsyoboieltr itsyoboieltr merged commit adf8559 into develop Jul 29, 2024
75 checks passed
@itsyoboieltr itsyoboieltr deleted the migrate-test-unit-global-to-jest branch July 29, 2024 15:39
@github-actions github-actions bot locked and limited conversation to collaborators Jul 29, 2024
@metamaskbot metamaskbot added the release-12.4.0 Issue or pull request that will be included in release 12.4.0 label Jul 29, 2024
@gauthierpetetin gauthierpetetin added the release-12.3.0 Issue or pull request that will be included in release 12.3.0 label Sep 11, 2024
@gauthierpetetin gauthierpetetin removed the release-12.4.0 Issue or pull request that will be included in release 12.4.0 label Sep 11, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
release-12.3.0 Issue or pull request that will be included in release 12.3.0 team-extension-platform
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

Migrate test/unit-global to Jest
5 participants