Summary
The OpenRNUpgradeHelper command (src/extension/commands/openRNUpgradeHelper.ts) has no unit tests. It presents a QuickPick with three platform choices (React Native, React Native Windows, React Native MacOS) and opens the corresponding URL via vscode.env.openExternal. The cancellation path (user dismisses the QuickPick) silently returns without opening any URL.
Why this is useful
All four execution paths are untested. Given that the QuickPick cancellation path has historically caused issues in similar commands (e.g. StopLogCatMonitor), having explicit coverage here reduces regression risk and keeps the command test suite consistent with the rest of the codebase.
Suggested scope
- Add
test/extension/commands/openRNUpgradeHelper.test.ts following the proxyquire pattern used in startPackager.test.ts and stopLogCatMonitor.test.ts
- Cover: "React Native" selected → correct RN URL passed to
openExternal
- Cover: "React Native Windows" selected → correct RNW URL passed to
openExternal
- Cover: "React Native MacOS" selected → correct RNM URL passed to
openExternal
- Cover: QuickPick cancelled (returns
undefined) → openExternal never called
Evidence
src/extension/commands/openRNUpgradeHelper.ts — four distinct code paths, all currently uncovered
test/extension/commands/stopLogCatMonitor.test.ts — reference pattern for stubbing vscode.window.showQuickPick and vscode.env.openExternal
- Recent trend of focused per-command test PRs:
restartPackager, stopLogCatMonitor, prebuildClean, setNewArch, enableHermes, enableExpoHermes
Validation
- Run
npm test / gulp test-unit and confirm all four new test cases pass
- Confirm
openExternal is not called in the cancellation test case
Summary
The
OpenRNUpgradeHelpercommand (src/extension/commands/openRNUpgradeHelper.ts) has no unit tests. It presents a QuickPick with three platform choices (React Native, React Native Windows, React Native MacOS) and opens the corresponding URL viavscode.env.openExternal. The cancellation path (user dismisses the QuickPick) silently returns without opening any URL.Why this is useful
All four execution paths are untested. Given that the QuickPick cancellation path has historically caused issues in similar commands (e.g.
StopLogCatMonitor), having explicit coverage here reduces regression risk and keeps the command test suite consistent with the rest of the codebase.Suggested scope
test/extension/commands/openRNUpgradeHelper.test.tsfollowing theproxyquirepattern used instartPackager.test.tsandstopLogCatMonitor.test.tsopenExternalopenExternalopenExternalundefined) →openExternalnever calledEvidence
src/extension/commands/openRNUpgradeHelper.ts— four distinct code paths, all currently uncoveredtest/extension/commands/stopLogCatMonitor.test.ts— reference pattern for stubbingvscode.window.showQuickPickandvscode.env.openExternalrestartPackager,stopLogCatMonitor,prebuildClean,setNewArch,enableHermes,enableExpoHermesValidation
npm test/gulp test-unitand confirm all four new test cases passopenExternalis not called in the cancellation test case