@@ -7,6 +7,7 @@ import os from "node:os";
77import path from "node:path" ;
88import { pathToFileURL } from "node:url" ;
99import { afterEach , describe , expect , it , vi } from "vitest" ;
10+ import { resolveWindowsTaskkillPath } from "../../scripts/lib/windows-taskkill.mjs" ;
1011import { withEnvAsync } from "../../src/test-utils/env.js" ;
1112
1213const tempDirs : string [ ] = [ ] ;
@@ -16,6 +17,10 @@ const runtimeSmokePath = path.resolve(
1617) ;
1718const sweepPath = path . resolve ( "scripts/e2e/lib/bundled-plugin-install-uninstall/sweep.sh" ) ;
1819
20+ function expectedTaskkillPath ( ) : string {
21+ return resolveWindowsTaskkillPath ( ) ;
22+ }
23+
1924type PluginListEntry = {
2025 id : string ;
2126 origin : string ;
@@ -452,17 +457,27 @@ describe("bundled plugin install/uninstall probe", () => {
452457 platform : "win32" ,
453458 runTaskkill,
454459 } ) ;
455- expect ( runTaskkill ) . toHaveBeenNthCalledWith ( 1 , "taskkill" , [ "/PID" , "12345" , "/T" ] , {
456- stdio : "ignore" ,
457- } ) ;
460+ expect ( runTaskkill ) . toHaveBeenNthCalledWith (
461+ 1 ,
462+ expectedTaskkillPath ( ) ,
463+ [ "/PID" , "12345" , "/T" ] ,
464+ {
465+ stdio : "ignore" ,
466+ } ,
467+ ) ;
458468
459469 runtimeSmoke . signalChildProcessTree ( child , "SIGKILL" , {
460470 platform : "win32" ,
461471 runTaskkill,
462472 } ) ;
463- expect ( runTaskkill ) . toHaveBeenNthCalledWith ( 2 , "taskkill" , [ "/PID" , "12345" , "/T" , "/F" ] , {
464- stdio : "ignore" ,
465- } ) ;
473+ expect ( runTaskkill ) . toHaveBeenNthCalledWith (
474+ 2 ,
475+ expectedTaskkillPath ( ) ,
476+ [ "/PID" , "12345" , "/T" , "/F" ] ,
477+ {
478+ stdio : "ignore" ,
479+ } ,
480+ ) ;
466481 expect ( child . kill ) . not . toHaveBeenCalled ( ) ;
467482 } ) ;
468483
@@ -482,12 +497,22 @@ describe("bundled plugin install/uninstall probe", () => {
482497 runTaskkill,
483498 } ) ;
484499
485- expect ( runTaskkill ) . toHaveBeenNthCalledWith ( 1 , "taskkill" , [ "/PID" , "12345" , "/T" ] , {
486- stdio : "ignore" ,
487- } ) ;
488- expect ( runTaskkill ) . toHaveBeenNthCalledWith ( 2 , "taskkill" , [ "/PID" , "12345" , "/T" , "/F" ] , {
489- stdio : "ignore" ,
490- } ) ;
500+ expect ( runTaskkill ) . toHaveBeenNthCalledWith (
501+ 1 ,
502+ expectedTaskkillPath ( ) ,
503+ [ "/PID" , "12345" , "/T" ] ,
504+ {
505+ stdio : "ignore" ,
506+ } ,
507+ ) ;
508+ expect ( runTaskkill ) . toHaveBeenNthCalledWith (
509+ 2 ,
510+ expectedTaskkillPath ( ) ,
511+ [ "/PID" , "12345" , "/T" , "/F" ] ,
512+ {
513+ stdio : "ignore" ,
514+ } ,
515+ ) ;
491516 expect ( child . kill ) . not . toHaveBeenCalled ( ) ;
492517 } ) ;
493518
0 commit comments