You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
StartNetworkInspector and StopNetworkInspector in src/extension/commands/networkInspector.ts have no unit tests. The module-level singleton inspectorManager means the "already running" early-return branch in StartNetworkInspector.baseFn is never exercised by any test, and the StopNetworkInspector delegation path is also untested at the command level.
Why this is useful
NetworkInspectorManager lifecycle is now well-covered (#2637), but the command classes that wrap it — including the guard logic and logger call — are not. Adding tests here closes the gap between manager-level and command-level coverage, and makes future changes to the guard or error handling safer to refactor.
Suggested scope
Add test/extension/networkInspector/networkInspector.test.ts using proxyquire to inject a fake NetworkInspectorManager
Cover: StartNetworkInspector calls manager.start when not running; logs and returns early when isRunning() is true; StopNetworkInspector always calls manager.stop
Evidence
src/extension/commands/networkInspector.ts:19 — module-level singleton, not injectable without proxyquire
src/extension/commands/networkInspector.ts:32-38 — isRunning() guard branch has no test coverage
test/extension/networkInspector/ — contains networkInspectorManager.test.ts but no command-level test file
Summary
StartNetworkInspectorandStopNetworkInspectorinsrc/extension/commands/networkInspector.tshave no unit tests. The module-level singletoninspectorManagermeans the "already running" early-return branch inStartNetworkInspector.baseFnis never exercised by any test, and theStopNetworkInspectordelegation path is also untested at the command level.Why this is useful
NetworkInspectorManagerlifecycle is now well-covered (#2637), but the command classes that wrap it — including the guard logic and logger call — are not. Adding tests here closes the gap between manager-level and command-level coverage, and makes future changes to the guard or error handling safer to refactor.Suggested scope
test/extension/networkInspector/networkInspector.test.tsusingproxyquireto inject a fakeNetworkInspectorManagerStartNetworkInspectorcallsmanager.startwhen not running; logs and returns early whenisRunning()is true;StopNetworkInspectoralways callsmanager.stopEvidence
src/extension/commands/networkInspector.ts:19— module-level singleton, not injectable without proxyquiresrc/extension/commands/networkInspector.ts:32-38—isRunning()guard branch has no test coveragetest/extension/networkInspector/— containsnetworkInspectorManager.test.tsbut no command-level test fileValidation
npm testand confirm the new suite passes