mirror of
https://github.com/morluto/rea.git
synced 2026-11-14 10:43:30 +00:00
`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>
24 lines
762 B
TypeScript
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");
|
|
},
|
|
);
|