Follow-up to #5. Builds on the vitest infra from src/core/settings.spec.ts.
Scope
src/commands/doctor.ts and the platform/dependency probes in src/infra/system.ts.
Cases to cover
doctor (src/commands/doctor.ts) — read-only diagnostics
- Reports project and global settings state:
configured (tokenline block present), invalid JSON, or not configured.
- Changes nothing on disk (assert no writes / no backups in a temp dir).
system.ts probes
checkPlatform() returns true on linux/darwin, false otherwise.
checkBash() / checkJq() parse --version output and gate on bash ≥ 4 — mock spawnSync (or inject) so the test doesn't depend on the host having a given bash/jq version.
Notes
- These probes shell out; prefer injecting/mocking the child-process boundary over relying on the CI runner's toolchain, so the suite stays hermetic and fast.
Acceptance
pnpm test stays green locally and in CI.
- The cases above are covered.
Follow-up to #5. Builds on the vitest infra from
src/core/settings.spec.ts.Scope
src/commands/doctor.tsand the platform/dependency probes insrc/infra/system.ts.Cases to cover
doctor(src/commands/doctor.ts) — read-only diagnosticsconfigured(tokenline block present),invalid JSON, ornot configured.system.tsprobescheckPlatform()returnstrueon linux/darwin,falseotherwise.checkBash()/checkJq()parse--versionoutput and gate on bash ≥ 4 — mockspawnSync(or inject) so the test doesn't depend on the host having a given bash/jq version.Notes
Acceptance
pnpm teststays green locally and in CI.