Skip to content

[Feature] Add unit tests for OpenEASProject command flow #2891

Description

@ConnorQi01

Summary

The OpenEASProject command (src/extension/commands/openEASProject.ts) has no unit test coverage. It contains multiple branching paths — non-Expo project early-exit, missing EAS project ID or owner, and the success path that opens the EAS URL — none of which are currently exercised by the test suite.

Why this is useful

Every other recently added command (runAndroid, runIos, runMacOS, runWindows, runExponent, runEasBuild) now has unit tests. Covering OpenEASProject closes the remaining gap in the EAS command test suite and makes regressions in the Expo/EAS workflow detectable without a full manual run.

Suggested scope

  • Add test/extension/commands/openEASProject.test.ts following the proxyquire + sinon pattern used by the other command tests.
  • Cover the non-Expo project path (should not call openExternal).
  • Cover the Expo path with missing id or owner (should show error message, not open URL).
  • Cover the success path with id, owner, and name all present (should call vscode.env.openExternal with the correct URL).
  • Cover the success path where name is null (no URL should be opened).

Evidence

  • src/extension/commands/openEASProject.ts — four distinct execution branches around isExpo, id, owner, and name.
  • No corresponding openEASProject.test.ts exists in test/extension/commands/.
  • Recent commits 68b2c926, 917c9eb7, 8962a02c, c6fdb05c show systematic test additions for run commands; openEASProject was not included.

Validation

  • Run npm test (or the mocha suite covering test/extension/commands/) and confirm all new test cases pass.
  • Confirm vscode.env.openExternal is called with the expected URL in the success case and not called in the error/non-Expo cases.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions