@@ -41,9 +41,10 @@ vi.mock("fs", () => ({
4141
4242vi . mock ( "../wiki-prompts/subtasks/constants" , ( ) => ( {
4343 getGlobalCommandsDir : vi . fn ( ( ) => "/home/user/.roo/commands" ) ,
44- subtaskDir : "/home/user/.roo/commands/project-wiki-tasks/" ,
44+ subtaskDir : "/home/user/.roo/commands/costrict- project-wiki-tasks/" ,
4545 MAIN_WIKI_FILENAME : "project-wiki.md" ,
4646 SUBTASK_FILENAMES : {
47+ VERSION_FILE : "version.md" ,
4748 PROJECT_OVERVIEW_TASK_FILE : "01_Project_Overview_Analysis.md" ,
4849 OVERALL_ARCHITECTURE_TASK_FILE : "02_Overall_Architecture_Analysis.md" ,
4950 SERVICE_DEPENDENCIES_TASK_FILE : "03_Service_Dependencies_Analysis.md" ,
@@ -129,7 +130,7 @@ describe("projectWikiHelpers", () => {
129130
130131 await ensureProjectWikiSubtasksExists ( )
131132
132- expect ( fs . promises . mkdir ) . toHaveBeenCalledWith ( "/home/user/.roo/commands/project-wiki-tasks/" , {
133+ expect ( fs . promises . mkdir ) . toHaveBeenCalledWith ( "/home/user/.roo/commands/costrict- project-wiki-tasks/" , {
133134 recursive : true ,
134135 } )
135136 expect ( fs . promises . writeFile ) . toHaveBeenCalled ( )
@@ -164,6 +165,7 @@ describe("projectWikiHelpers", () => {
164165 isDirectory : ( ) => true ,
165166 } as any )
166167 vi . mocked ( fs . promises . readdir ) . mockResolvedValue ( [
168+ "version.md" ,
167169 "01_Project_Overview_Analysis.md" ,
168170 "02_Overall_Architecture_Analysis.md" ,
169171 "03_Service_Dependencies_Analysis.md" ,
@@ -176,6 +178,8 @@ describe("projectWikiHelpers", () => {
176178 "10_Index_Generation.md" ,
177179 "11_Project_Rules_Generation.md" ,
178180 ] as any )
181+ // Mock 版本文件内容,确保版本检查通过
182+ vi . mocked ( fs . promises . readFile ) . mockResolvedValue ( `version: "v1.0.5"` )
179183 vi . mocked ( fs . promises . mkdir ) . mockResolvedValue ( undefined )
180184 vi . mocked ( fs . promises . writeFile ) . mockResolvedValue ( undefined )
181185 vi . mocked ( fs . promises . rm ) . mockResolvedValue ( undefined )
@@ -241,7 +245,7 @@ describe("projectWikiHelpers", () => {
241245 expect ( mockLogger . info ) . toHaveBeenCalledWith (
242246 "[projectWikiHelpers] Starting ensureProjectWikiSubtasksExists..." ,
243247 )
244- expect ( fs . promises . mkdir ) . toHaveBeenCalledWith ( "/home/user/.roo/commands/project-wiki-tasks/" , {
248+ expect ( fs . promises . mkdir ) . toHaveBeenCalledWith ( "/home/user/.roo/commands/costrict- project-wiki-tasks/" , {
245249 recursive : true ,
246250 } )
247251 } )
0 commit comments