-
Notifications
You must be signed in to change notification settings - Fork 3.4k
chore: convert @packages/launcher
tests from mocha
to vitest
#32656
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
Open
AtofStryker
wants to merge
8
commits into
develop
Choose a base branch
from
chore/launcher_vitest
base: develop
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+2,028
−1,690
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
cypress
|
Project |
cypress
|
Branch Review |
chore/launcher_vitest
|
Run status |
|
Run duration | 19m 59s |
Commit |
|
Committer | Bill Glesias |
View all properties for this run ↗︎ |
Test results | |
---|---|
|
1
|
|
9
|
|
1102
|
|
4
|
|
26690
|
View all changes introduced in this branch ↗︎ |
Warning
Partial Report: The results for the Application Quality reports may be incomplete.
UI Coverage
45.24%
|
|
---|---|
|
185
|
|
157
|
Accessibility
97.96%
|
|
---|---|
|
4 critical
8 serious
2 moderate
2 minor
|
|
101
|
Tests for review
cypress/e2e/studio/studio.cy.ts • 1 failed test • app-e2e
Test | Artifacts | |
---|---|---|
Cypress Studio > creates a new test from an empty spec |
Test Replay
Screenshots
|
issues/28527.cy.ts • 1 flaky test • 5x-driver-electron
Test | Artifacts | |
---|---|---|
issue 28527 > fails and then retries and verifies about:blank is not displayed |
Test Replay
Screenshots
|
commands/files.cy.js • 1 flaky test • 5x-driver-firefox
Test | Artifacts | |||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
src/cy/commands/files > #readFile > retries to read when ENOENT |
|
Test | Artifacts | |||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
cy.origin- Cypress.config() > serializable > overwrites different values in secondary if one exists in the primary |
|
Test | Artifacts | |
---|---|---|
issue 28527 > fails and then retries and verifies about:blank is not displayed |
Screenshots
|
issues/28527.cy.ts • 1 flaky test • 5x-driver-chrome
Test | Artifacts | |
---|---|---|
issue 28527 > fails and then retries and verifies about:blank is not displayed |
Test Replay
Screenshots
|
The first 5 flaky specs are shown, see all 9 specs in Cypress Cloud.
e4af658
to
bc821e8
Compare
@packages/launcher
tests from mocha
to vitest
@packages/launcher
tests from mocha
to vitest
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Additional details
Converts the
@packages/launcher
tests tovitest
frommocha
.Snapshots
snapshots should mostly be 1:1 but the
vitest
snapshots do include theversionRegex
. ThefindAppParams
snapshot values in thewindows
snapshot are not present because we do not actually calculate these values in the code forwindows
. They look like they came from the MacOS detector at some point due to the values populated in the snapshot, all to say these are not expected to be carried over into the new snapshots.Tests
A lot of the detector tests needed to be reworked as we can longer leverage
withArgs
orcallsArgAsync
, so many of the mocking around the child process leverages callback handlers that are defined in the test to get a specific outcome from the yielding process.We no longer stub
utils.getOutput
or helper methods and instead mock the libraries they are consuming, such as'child_process'
or'win-version-info'
to more accurately test our implementation.This tests the same functionality, except maybe slightly deeper, but overall the tests are the same
Implementation
Only thing that has really changed with the implementation is to always prioritize 64-bit browser installs over 32-bit. Before, the priority was mixed and this makes the prioritization consistent
Steps to test
How has the user experience changed?
PR Tasks
cypress-documentation
?type definitions
?Note
Migrates @packages/launcher tests to Vitest with new snapshots/config, refactors darwin/windows utilities, and updates CI/browser-tools and docs.
mocha/chai/sinon
tovitest
; addvitest.config.ts
and new__snapshots__
undertest/unit/**
.mocha.opts
,spec_helper.ts
, and old snapshot files.package.json
scripts (test-unit
->vitest run
, addtest-debug
) and devDeps (addvitest
, drop mocha/chai/sinon).lib/darwin/util.ts
: switch to default imports forfs-extra
,path
,plist
.lib/windows/index.ts
: usefs-extra
default import; reorder Chrome/Chromium path preferences; usefs.pathExists
; call localgetVersionString
directly.browser-tools
orb to2.3.1
; for Chrome install setreplace_existing: true
.10
to9
.packages/launcher
as completed.Written by Cursor Bugbot for commit 1b1de36. This will update automatically on new commits. Configure here.