fix: build 命令在 plan 未完成时给出友好提示而非未预期错误
This commit is contained in:
@@ -184,10 +184,15 @@ describe("assembleBuildPrompt", () => {
|
||||
expect(prompt).toContain("归档");
|
||||
});
|
||||
|
||||
it("task.md 不存在时抛出错误", async () => {
|
||||
await expect(
|
||||
assembleBuildPrompt(defaultConfig, TMP_DIR, "nonexistent"),
|
||||
).rejects.toThrow("task.md not found");
|
||||
it("task.md 不存在时抛出 CommandError 并附带提示", async () => {
|
||||
try {
|
||||
await assembleBuildPrompt(defaultConfig, TMP_DIR, "nonexistent");
|
||||
expect.unreachable();
|
||||
} catch (e: any) {
|
||||
expect(e.message).toContain("尚未完成规划");
|
||||
expect(e.message).toContain("nonexistent");
|
||||
expect(e.hint).toContain("rune plan");
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user