Skip to content

Conversation

AtofStryker
Copy link
Contributor

@AtofStryker AtofStryker commented Oct 6, 2025

  • Closes N/A

Additional details

Converts the @packages/launcher tests to vitest from mocha.

Snapshots

snapshots should mostly be 1:1 but the vitest snapshots do include the versionRegex. The findAppParams snapshot values in the windows snapshot are not present because we do not actually calculate these values in the code for windows. 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 or callsArgAsync, 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


Note

Migrates @packages/launcher tests to Vitest with new snapshots/config, refactors darwin/windows utilities, and updates CI/browser-tools and docs.

  • @packages/launcher (tests):
    • Migrate unit tests from mocha/chai/sinon to vitest; add vitest.config.ts and new __snapshots__ under test/unit/**.
    • Remove legacy mocha.opts, spec_helper.ts, and old snapshot files.
    • Update package.json scripts (test-unit -> vitest run, add test-debug) and devDeps (add vitest, drop mocha/chai/sinon).
  • Launcher utilities:
    • lib/darwin/util.ts: switch to default imports for fs-extra, path, plist.
    • lib/windows/index.ts: use fs-extra default import; reorder Chrome/Chromium path preferences; use fs.pathExists; call local getVersionString directly.
  • CI:
    • Bump CircleCI browser-tools orb to 2.3.1; for Chrome install set replace_existing: true.
    • Adjust unit test Mocha results expectation from 10 to 9.
  • Docs:
    • Update ESM migration guide to mark packages/launcher as completed.

Written by Cursor Bugbot for commit 1b1de36. This will update automatically on new commits. Configure here.

cursor[bot]

This comment was marked as outdated.

Copy link

cypress bot commented Oct 6, 2025

cypress    Run #66230

Run Properties:  status check failed Failed #66230  •  git commit 1b1de360d5: chore: fix detect spec to use actual implementation of cp.spawn
Project cypress
Branch Review chore/launcher_vitest
Run status status check failed Failed #66230
Run duration 19m 59s
Commit git commit 1b1de360d5: chore: fix detect spec to use actual implementation of cp.spawn
Committer Bill Glesias
View all properties for this run ↗︎

Test results
Tests that failed  Failures 1
Tests that were flaky  Flaky 9
Tests that did not run due to a developer annotating a test with .skip  Pending 1102
Tests that did not run due to a failure in a mocha hook  Skipped 4
Tests that passed  Passing 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%
  Untested elements 185  
  Tested elements 157  
Accessibility  97.96%
  Failed rules  4 critical   8 serious   2 moderate   2 minor
  Failed elements 101  

Tests for review

Failed  cypress/e2e/studio/studio.cy.ts • 1 failed test • app-e2e

View Output

Test Artifacts
Cypress Studio > creates a new test from an empty spec Test Replay Screenshots
Flakiness  issues/28527.cy.ts • 1 flaky test • 5x-driver-electron

View Output

Test Artifacts
issue 28527 > fails and then retries and verifies about:blank is not displayed Test Replay Screenshots
Flakiness  commands/files.cy.js • 1 flaky test • 5x-driver-firefox

View Output

Test Artifacts
src/cy/commands/files > #readFile > retries to read when ENOENT
    </td>
  </tr></table>
Flakiness  e2e/origin/config_env.cy.ts • 1 flaky test • 5x-driver-firefox

View Output

Test Artifacts
cy.origin- Cypress.config() > serializable > overwrites different values in secondary if one exists in the primary
    </td>
  </tr></table>
Flakiness  issues/28527.cy.ts • 1 flaky test • 5x-driver-firefox

View Output

Test Artifacts
issue 28527 > fails and then retries and verifies about:blank is not displayed Screenshots
Flakiness  issues/28527.cy.ts • 1 flaky test • 5x-driver-chrome

View Output

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.

@AtofStryker AtofStryker force-pushed the chore/launcher_vitest branch from e4af658 to bc821e8 Compare October 6, 2025 14:51
@AtofStryker AtofStryker changed the title chore (DRAFT): convert @packages/launcher tests from mocha to vitest chore: convert @packages/launcher tests from mocha to vitest Oct 6, 2025
@AtofStryker AtofStryker self-assigned this Oct 6, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant