@@ -23,10 +23,15 @@ import {
2323 startLocalSut ,
2424 waitForLog ,
2525} from "../../scripts/e2e/telegram-user-crabbox-proof.ts" ;
26+ import { resolveWindowsTaskkillPath } from "../../scripts/lib/windows-taskkill.mjs" ;
2627
2728const tempDirs : string [ ] = [ ] ;
2829const posixIt = process . platform === "win32" ? it . skip : it ;
2930
31+ function expectedTaskkillPath ( ) : string {
32+ return resolveWindowsTaskkillPath ( ) ;
33+ }
34+
3035function makeTempDir ( ) : string {
3136 const dir = fs . mkdtempSync ( path . join ( os . tmpdir ( ) , "openclaw-telegram-proof-" ) ) ;
3237 tempDirs . push ( dir ) ;
@@ -364,17 +369,27 @@ setInterval(() => {}, 1000);
364369 platform : "win32" ,
365370 runTaskkill,
366371 } ) ;
367- expect ( runTaskkill ) . toHaveBeenNthCalledWith ( 1 , "taskkill" , [ "/PID" , "12345" , "/T" ] , {
368- stdio : "ignore" ,
369- } ) ;
372+ expect ( runTaskkill ) . toHaveBeenNthCalledWith (
373+ 1 ,
374+ expectedTaskkillPath ( ) ,
375+ [ "/PID" , "12345" , "/T" ] ,
376+ {
377+ stdio : "ignore" ,
378+ } ,
379+ ) ;
370380
371381 signalCommandTree ( child , "SIGKILL" , {
372382 platform : "win32" ,
373383 runTaskkill,
374384 } ) ;
375- expect ( runTaskkill ) . toHaveBeenNthCalledWith ( 2 , "taskkill" , [ "/PID" , "12345" , "/T" , "/F" ] , {
376- stdio : "ignore" ,
377- } ) ;
385+ expect ( runTaskkill ) . toHaveBeenNthCalledWith (
386+ 2 ,
387+ expectedTaskkillPath ( ) ,
388+ [ "/PID" , "12345" , "/T" , "/F" ] ,
389+ {
390+ stdio : "ignore" ,
391+ } ,
392+ ) ;
378393 expect ( child . kill ) . not . toHaveBeenCalled ( ) ;
379394 } ) ;
380395
@@ -393,12 +408,22 @@ setInterval(() => {}, 1000);
393408 runTaskkill,
394409 } ) ;
395410
396- expect ( runTaskkill ) . toHaveBeenNthCalledWith ( 1 , "taskkill" , [ "/PID" , "12345" , "/T" ] , {
397- stdio : "ignore" ,
398- } ) ;
399- expect ( runTaskkill ) . toHaveBeenNthCalledWith ( 2 , "taskkill" , [ "/PID" , "12345" , "/T" , "/F" ] , {
400- stdio : "ignore" ,
401- } ) ;
411+ expect ( runTaskkill ) . toHaveBeenNthCalledWith (
412+ 1 ,
413+ expectedTaskkillPath ( ) ,
414+ [ "/PID" , "12345" , "/T" ] ,
415+ {
416+ stdio : "ignore" ,
417+ } ,
418+ ) ;
419+ expect ( runTaskkill ) . toHaveBeenNthCalledWith (
420+ 2 ,
421+ expectedTaskkillPath ( ) ,
422+ [ "/PID" , "12345" , "/T" , "/F" ] ,
423+ {
424+ stdio : "ignore" ,
425+ } ,
426+ ) ;
402427 expect ( child . kill ) . not . toHaveBeenCalled ( ) ;
403428 } ) ;
404429
0 commit comments