Skip to content

refactor: make dev-server, login, and sourcemaps commands testable via CallCmd()#654

Open
zmdavis wants to merge 1 commit intomainfrom
zdavis/dev-server-testing
Open

refactor: make dev-server, login, and sourcemaps commands testable via CallCmd()#654
zmdavis wants to merge 1 commit intomainfrom
zdavis/dev-server-testing

Conversation

@zmdavis
Copy link
Contributor

@zmdavis zmdavis commented Mar 10, 2026

Requirements

  • I have added test coverage for new or changed functionality
  • I have followed the repository's pull request submission guidelines
  • I have validated my changes against all supported platform versions

Describe the solution you've provided

Wire NewStartServerCmd, NewLoginCmd, and NewSourcemapsCmd through the existing APIClients struct instead of constructing hardcoded real clients inline. Add dev_server.MockClient and three tests for start_server.go.

This is the first step in a larger effort to improve test coverage in this repo.


Note

Low Risk
Primarily dependency-injection and new unit tests; runtime behavior should be unchanged aside from how clients are constructed and passed in.

Overview
Refactors CLI wiring so login, dev-server, and sourcemaps commands use clients provided via cmd.APIClients rather than constructing real resources/dev_server clients inline, making these commands testable through cmd.CallCmd().

Adds a dev_server.MockClient and new dev-server start tests that assert --context and --override JSON are parsed and forwarded to RunServer, and that malformed context JSON returns an error without starting the server.

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

…ia CallCmd()

Wire NewStartServerCmd, NewLoginCmd, and NewSourcemapsCmd through the existing APIClients struct instead of constructing hardcoded real clients inline. Add dev_server.MockClient and three tests for start_server.go.
@zmdavis zmdavis requested a review from cspath1 March 10, 2026 20:29
@zmdavis zmdavis changed the title (refactor) make dev-server, login, and sourcemaps commands testable via CallCmd() refactor: make dev-server, login, and sourcemaps commands testable via CallCmd() Mar 10, 2026
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.

3 participants