Summary
The RunExponent command (src/extension/commands/runExponent.ts) has no unit test coverage. It is the only Run* command without a dedicated test file, while RunAndroid, RunIOS, RunEasBuild, and RunMacOS/RunWindows (tracked in #2882) already have or are getting tests.
Why this is useful
Unit tests for RunExponent will catch regressions in the Expo packager startup flow and the login step (onBeforeExecute) before they reach users. The command has two distinct code paths that benefit from isolation testing: the packager lifecycle (beforeStartPackager → startPackager) and the Expo login fallback on error.
Suggested scope
- Mock
ProjectVersionHelper.getReactNativePackageVersionsFromNodeModules, ExponentPlatform, loginToExponent, and ReactNativeCommand base class using the same proxyquire / Sinon pattern used in runAndroid.test.ts and runIos.test.ts.
- Cover the happy path: version resolution →
ExponentPlatform constructor called with correct PlatformType.Exponent → beforeStartPackager → startPackager.
- Cover
onBeforeExecute: loginToExponent is called; verify that a login failure propagates as a rejection.
- Verify that
setReactNativeVersions is called with the resolved versions.
Evidence
Validation
npm run test passes with the new test file.
- Test suite reports coverage for
runExponent.ts baseFn and onBeforeExecute branches.
Summary
The
RunExponentcommand (src/extension/commands/runExponent.ts) has no unit test coverage. It is the onlyRun*command without a dedicated test file, whileRunAndroid,RunIOS,RunEasBuild, andRunMacOS/RunWindows(tracked in #2882) already have or are getting tests.Why this is useful
Unit tests for
RunExponentwill catch regressions in the Expo packager startup flow and the login step (onBeforeExecute) before they reach users. The command has two distinct code paths that benefit from isolation testing: the packager lifecycle (beforeStartPackager→startPackager) and the Expo login fallback on error.Suggested scope
ProjectVersionHelper.getReactNativePackageVersionsFromNodeModules,ExponentPlatform,loginToExponent, andReactNativeCommandbase class using the sameproxyquire/ Sinon pattern used inrunAndroid.test.tsandrunIos.test.ts.ExponentPlatformconstructor called with correctPlatformType.Exponent→beforeStartPackager→startPackager.onBeforeExecute:loginToExponentis called; verify that a login failure propagates as a rejection.setReactNativeVersionsis called with the resolved versions.Evidence
src/extension/commands/runExponent.ts— 30-line implementation with two-phase flow (login + packager start).test/extension/commands/runAndroid.test.ts,runIos.test.ts— established patterns for mockingReactNativeCommandand platform constructors.Run*command tests;runExponentis the remaining gap.Validation
npm run testpasses with the new test file.runExponent.tsbaseFnandonBeforeExecutebranches.