chore: 添加 .oxfmtrc.json 并格式化全部代码
This commit is contained in:
@@ -38,12 +38,7 @@ describe("assembleDiscussPrompt", () => {
|
||||
|
||||
describe("assemblePlanPrompt", () => {
|
||||
it("包含指定文档名称和提示词", async () => {
|
||||
const prompt = await assemblePlanPrompt(
|
||||
defaultConfig,
|
||||
TMP_DIR,
|
||||
"user-auth",
|
||||
"design",
|
||||
);
|
||||
const prompt = await assemblePlanPrompt(defaultConfig, TMP_DIR, "user-auth", "design");
|
||||
expect(prompt).toContain("user-auth");
|
||||
expect(prompt).toContain("design");
|
||||
expect(prompt).not.toContain("task");
|
||||
@@ -53,23 +48,13 @@ describe("assemblePlanPrompt", () => {
|
||||
const changeDir = join(TMP_DIR, ".rune", "changes", "user-auth");
|
||||
await mkdir(changeDir, { recursive: true });
|
||||
await writeFile(join(changeDir, "design.md"), "# 已有设计");
|
||||
const prompt = await assemblePlanPrompt(
|
||||
defaultConfig,
|
||||
TMP_DIR,
|
||||
"user-auth",
|
||||
"design",
|
||||
);
|
||||
const prompt = await assemblePlanPrompt(defaultConfig, TMP_DIR, "user-auth", "design");
|
||||
expect(prompt).toContain("已有设计");
|
||||
expect(prompt).toContain("在此基础上修订");
|
||||
});
|
||||
|
||||
it("替换模板中的 {{change-name}}", async () => {
|
||||
const prompt = await assemblePlanPrompt(
|
||||
defaultConfig,
|
||||
TMP_DIR,
|
||||
"user-auth",
|
||||
"design",
|
||||
);
|
||||
const prompt = await assemblePlanPrompt(defaultConfig, TMP_DIR, "user-auth", "design");
|
||||
expect(prompt).toContain("user-auth 设计文档");
|
||||
expect(prompt).not.toContain("{{change-name}}");
|
||||
});
|
||||
@@ -85,23 +70,13 @@ describe("assemblePlanPrompt", () => {
|
||||
},
|
||||
},
|
||||
};
|
||||
const prompt = await assemblePlanPrompt(
|
||||
config,
|
||||
TMP_DIR,
|
||||
"user-auth",
|
||||
"task",
|
||||
);
|
||||
const prompt = await assemblePlanPrompt(config, TMP_DIR, "user-auth", "task");
|
||||
expect(prompt).toContain("依赖说明");
|
||||
expect(prompt).toContain("design.md");
|
||||
});
|
||||
|
||||
it("无依赖时不包含依赖说明", async () => {
|
||||
const prompt = await assemblePlanPrompt(
|
||||
defaultConfig,
|
||||
TMP_DIR,
|
||||
"user-auth",
|
||||
"design",
|
||||
);
|
||||
const prompt = await assemblePlanPrompt(defaultConfig, TMP_DIR, "user-auth", "design");
|
||||
expect(prompt).not.toContain("依赖说明");
|
||||
});
|
||||
|
||||
@@ -120,12 +95,7 @@ describe("assemblePlanPrompt", () => {
|
||||
},
|
||||
},
|
||||
};
|
||||
const prompt = await assemblePlanPrompt(
|
||||
config,
|
||||
TMP_DIR,
|
||||
"user-auth",
|
||||
"task",
|
||||
);
|
||||
const prompt = await assemblePlanPrompt(config, TMP_DIR, "user-auth", "task");
|
||||
expect(prompt).toContain("已完成");
|
||||
});
|
||||
|
||||
@@ -154,15 +124,8 @@ describe("assembleBuildPrompt", () => {
|
||||
it("包含待执行任务列表", async () => {
|
||||
const changeDir = join(TMP_DIR, ".rune", "changes", "user-auth");
|
||||
await mkdir(changeDir, { recursive: true });
|
||||
await writeFile(
|
||||
join(changeDir, "task.md"),
|
||||
`- [x] 任务一\n- [ ] 任务二\n- [ ] 任务三`,
|
||||
);
|
||||
const prompt = await assembleBuildPrompt(
|
||||
defaultConfig,
|
||||
TMP_DIR,
|
||||
"user-auth",
|
||||
);
|
||||
await writeFile(join(changeDir, "task.md"), `- [x] 任务一\n- [ ] 任务二\n- [ ] 任务三`);
|
||||
const prompt = await assembleBuildPrompt(defaultConfig, TMP_DIR, "user-auth");
|
||||
expect(prompt).toContain("任务二");
|
||||
expect(prompt).toContain("待执行任务");
|
||||
expect(prompt).toContain("共 2 项");
|
||||
@@ -171,15 +134,8 @@ describe("assembleBuildPrompt", () => {
|
||||
it("所有任务完成时提示可归档", async () => {
|
||||
const changeDir = join(TMP_DIR, ".rune", "changes", "user-auth");
|
||||
await mkdir(changeDir, { recursive: true });
|
||||
await writeFile(
|
||||
join(changeDir, "task.md"),
|
||||
`- [x] 任务一\n- [x] 任务二`,
|
||||
);
|
||||
const prompt = await assembleBuildPrompt(
|
||||
defaultConfig,
|
||||
TMP_DIR,
|
||||
"user-auth",
|
||||
);
|
||||
await writeFile(join(changeDir, "task.md"), `- [x] 任务一\n- [x] 任务二`);
|
||||
const prompt = await assembleBuildPrompt(defaultConfig, TMP_DIR, "user-auth");
|
||||
expect(prompt).toContain("已完成");
|
||||
expect(prompt).toContain("归档");
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user