@@ -148,7 +148,9 @@ describe('Worktree Docker Compose Cleanup', function () {
148148
149149 it ( 'should still remove the worktree when lib/compose-utils cannot be loaded' , function ( ) {
150150 const origSpawnSync = childProcess . spawnSync ;
151+ const origWarn = console . warn ;
151152 const calls = [ ] ;
153+ const warnings = [ ] ;
152154
153155 childProcess . spawnSync = function ( command , args , opts ) {
154156 calls . push ( { command, args, cwd : opts ?. cwd } ) ;
@@ -157,6 +159,7 @@ describe('Worktree Docker Compose Cleanup', function () {
157159 }
158160 return { status : 0 , stdout : '' , stderr : '' } ;
159161 } ;
162+ console . warn = ( message ) => warnings . push ( message ) ;
160163
161164 try {
162165 delete require . cache [ require . resolve ( '../src/isolation-manager' ) ] ;
@@ -191,8 +194,12 @@ describe('Worktree Docker Compose Cleanup', function () {
191194 ) ,
192195 'worktree removal should still proceed'
193196 ) ;
197+ assert . deepStrictEqual ( warnings , [
198+ `[IsolationManager] Skipping Docker Compose teardown in ${ fakeWorktreePath } : Cannot find module 'js-yaml'` ,
199+ ] ) ;
194200 } finally {
195201 childProcess . spawnSync = origSpawnSync ;
202+ console . warn = origWarn ;
196203 delete require . cache [ require . resolve ( '../src/isolation-manager' ) ] ;
197204 }
198205 } ) ;
0 commit comments