Files
reverse-engineering-anything/tests/boundary/cli/emptyDoctorTargetCli.test.ts
T
gensokyo-devandClaude Opus 5.5 82f3bfb6e8 fix(doctor): refuse an empty --target like other target inputs
`rea doctor --target ""` passed an empty string to target readiness,
which checked the working directory instead of reporting that no app
was named. Use the shared local path schema, so an empty target fails
validation before any readiness check, as every other target does.

Fixes #7561

Co-Authored-By: gensokyo-dev <gensokyo-dev@users.noreply.github.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-14 05:36:32 +01:00

24 lines
762 B
TypeScript

import { expect } from "vitest";
import { cliTest } from "../../support/cli/cliFixture.js";
// An empty --target names no app. Like every other target-taking command,
// doctor refuses it before readiness checks instead of checking the
// working directory.
cliTest(
"refuses an empty doctor --target before any readiness check",
async ({ cli }) => {
const result = await cli.run({
arguments: ["doctor", "--target", "", "--json"],
});
expect(result.exitCode).toBe(1);
expect(JSON.parse(result.stdout)).toMatchObject({
code: "VALIDATION_ERROR",
fieldErrors: expect.arrayContaining([
expect.objectContaining({ path: "target" }),
]),
});
expect(result.stdout).not.toContain("target_readiness");
},
);