mirror of
https://github.com/morluto/rea.git
synced 2026-10-31 20:06:14 +00:00
fix(cli): fail commands returning projected analysis errors (#506)
Signed-off-by: Rudy Celekli <47457359+rudycelekli@users.noreply.github.com>
This commit is contained in:
1 parent
55f0267c40
commit
2fd11961cf
3 files changed
+59
No files matched your search
@@ -1,9 +1,15 @@
|
||||
import { describe, expect, it } from "vitest";
|
||||
|
||||
import { ConfigurationError, projectAnalysisError } from "./domain/errors.js";
|
||||
|
||||
import { isCliOperationFailure } from "./cliLogging.js";
|
||||
|
||||
describe("CLI operation status classification", () => {
|
||||
it.each([
|
||||
[
|
||||
"projected error",
|
||||
projectAnalysisError(new ConfigurationError("invalid setting")),
|
||||
],
|
||||
["typed error", { error: "Analysis failed", category: "timeout" }],
|
||||
["unhealthy diagnostic", { healthy: false, checks: [] }],
|
||||
["failed status", { status: "failed" }],
|
||||
@@ -15,6 +21,16 @@ describe("CLI operation status classification", () => {
|
||||
});
|
||||
|
||||
it.each([
|
||||
[
|
||||
"ordinary data with code",
|
||||
{ code: "configuration_invalid", message: "source data" },
|
||||
],
|
||||
[
|
||||
"evidence about an error",
|
||||
{
|
||||
result: projectAnalysisError(new ConfigurationError("source setting")),
|
||||
},
|
||||
],
|
||||
["ready setup", { status: "ready" }],
|
||||
["complete uninstall", { status: "complete" }],
|
||||
["current version", { status: "current" }],
|
||||
|
||||
Reference in new issue
Block a user