@@ -36,13 +36,23 @@ suite("Roo Import", function () {
3636 setDefaultSuiteTimeout ( this )
3737
3838 let tmpDir : string
39+ const importedTaskIds : string [ ] = [ ]
3940
4041 suiteSetup ( async ( ) => {
4142 tmpDir = await fs . mkdtemp ( path . join ( os . tmpdir ( ) , "zoo-e2e-roo-import-" ) )
4243 } )
4344
4445 suiteTeardown ( async ( ) => {
4546 await fs . rm ( tmpDir , { recursive : true , force : true } )
47+
48+ const storagePath = globalThis . api ?. storagePath
49+ if ( storagePath ) {
50+ await Promise . all (
51+ importedTaskIds . map ( ( id ) =>
52+ fs . rm ( path . join ( storagePath , "tasks" , id ) , { recursive : true , force : true } ) ,
53+ ) ,
54+ )
55+ }
4656 } )
4757
4858 test ( "importRooHandoff command is registered" , async ( ) => {
@@ -61,6 +71,7 @@ suite("Roo Import", function () {
6171 const handoffDir = path . join ( tmpDir , "handoff" )
6272 const tasksSource = path . join ( handoffDir , "data" , "tasks" )
6373 const taskId = `e2e-test-task-${ Date . now ( ) } `
74+ importedTaskIds . push ( taskId )
6475 await fs . mkdir ( path . join ( tasksSource , taskId ) , { recursive : true } )
6576 await fs . writeFile ( path . join ( tasksSource , taskId , "history_item.json" ) , JSON . stringify ( { id : taskId } ) )
6677
@@ -83,7 +94,7 @@ suite("Roo Import", function () {
8394 assert . strictEqual ( contents . id , taskId , "Task file content should match what was exported" )
8495 } )
8596
86- test ( "skips import when handoff was already imported " , async ( ) => {
97+ test ( "re-runs import with an explicit path without throwing " , async ( ) => {
8798 const handoffPath = path . join ( tmpDir , "handoff-duplicate.json" )
8899 const createdAt = new Date ( ) . toISOString ( )
89100 await fs . writeFile ( handoffPath , JSON . stringify ( makeHandoff ( { createdAt } ) ) )
0 commit comments