@@ -56,6 +56,7 @@ describe("migrate", () => {
5656 let commandStub : sinon . SinonStub ;
5757 let trackStub : sinon . SinonStub ;
5858 let confirmStub : sinon . SinonStub ;
59+ let unlinkStub : sinon . SinonStub ;
5960 let spawnStub : sinon . SinonStub ;
6061
6162 beforeEach ( ( ) => {
@@ -103,7 +104,7 @@ describe("migrate", () => {
103104
104105 writeFileStub = sandbox . stub ( fs , "writeFile" ) . resolves ( ) ;
105106 mkdirStub = sandbox . stub ( fs , "mkdir" ) . resolves ( ) ;
106- sandbox . stub ( fs , "unlink" ) . resolves ( ) ;
107+ unlinkStub = sandbox . stub ( fs , "unlink" ) . resolves ( ) ;
107108 sandbox . stub ( fs , "readdir" ) . resolves ( [ ] ) ;
108109 accessStub = sandbox . stub ( fs , "access" ) . rejects ( { code : "ENOENT" } ) ;
109110
@@ -503,6 +504,11 @@ describe("migrate", () => {
503504 expect ( confirmStub . called ) . to . be . true ;
504505 } ) ;
505506
507+ it ( "should delete .idx/mcp.json if it exists" , async ( ) => {
508+ await migrate ( testRoot ) ;
509+ expect ( unlinkStub . calledWith ( path . join ( testRoot , ".idx" , "mcp.json" ) ) ) . to . be . true ;
510+ } ) ;
511+
506512 it ( "should configure Dart MCP server for Flutter apps if dart is available" , async ( ) => {
507513 accessStub . withArgs ( sinon . match ( "pubspec.yaml" ) ) . resolves ( ) ;
508514 commandStub . withArgs ( "dart" ) . returns ( true ) ;
0 commit comments