Skip to content

Test the doctor command + platform/dependency probes #34

Description

@ropdias

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    area:installerinstall.sh + npm CLI (src/cli.ts), settings.json patchingeffort:SOne file + check (~1h)testingTests and test infrastructure

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions