




















@@ -12,6 +12,7 @@ import {
1212resolveGroupKey,
1313resolveTestArea,
1414} from "../../scripts/lib/test-group-report.mjs";
15+import { resolveWindowsTaskkillPath } from "../../scripts/lib/windows-taskkill.mjs";
1516import {
1617parseTestGroupReportArgs,
1718resolveFullSuiteVitestEnv,
@@ -65,6 +66,10 @@ async function waitForDead(pid: number, timeoutMs: number): Promise<void> {
6566throw new Error(`timed out waiting for pid ${pid} to exit`);
6667}
676869+function expectedTaskkillPath(): string {
70+return resolveWindowsTaskkillPath();
71+}
72+6873function waitForChildClose(
6974child: ReturnType<typeof spawn>,
7075timeoutMs = 5_000,
@@ -622,17 +627,27 @@ describe("scripts/test-group-report child process guard", () => {
622627platform: "win32",
623628 runTaskkill,
624629});
625-expect(runTaskkill).toHaveBeenNthCalledWith(1, "taskkill", ["/PID", "12345", "/T"], {
626-stdio: "ignore",
627-});
630+expect(runTaskkill).toHaveBeenNthCalledWith(
631+1,
632+expectedTaskkillPath(),
633+["/PID", "12345", "/T"],
634+{
635+stdio: "ignore",
636+},
637+);
628638629639signalTestGroupReportChild(child, "SIGKILL", {
630640platform: "win32",
631641 runTaskkill,
632642});
633-expect(runTaskkill).toHaveBeenNthCalledWith(2, "taskkill", ["/PID", "12345", "/T", "/F"], {
634-stdio: "ignore",
635-});
643+expect(runTaskkill).toHaveBeenNthCalledWith(
644+2,
645+expectedTaskkillPath(),
646+["/PID", "12345", "/T", "/F"],
647+{
648+stdio: "ignore",
649+},
650+);
636651expect(child.kill).not.toHaveBeenCalled();
637652});
638653@@ -651,12 +666,22 @@ describe("scripts/test-group-report child process guard", () => {
651666 runTaskkill,
652667});
653668654-expect(runTaskkill).toHaveBeenNthCalledWith(1, "taskkill", ["/PID", "12345", "/T"], {
655-stdio: "ignore",
656-});
657-expect(runTaskkill).toHaveBeenNthCalledWith(2, "taskkill", ["/PID", "12345", "/T", "/F"], {
658-stdio: "ignore",
659-});
669+expect(runTaskkill).toHaveBeenNthCalledWith(
670+1,
671+expectedTaskkillPath(),
672+["/PID", "12345", "/T"],
673+{
674+stdio: "ignore",
675+},
676+);
677+expect(runTaskkill).toHaveBeenNthCalledWith(
678+2,
679+expectedTaskkillPath(),
680+["/PID", "12345", "/T", "/F"],
681+{
682+stdio: "ignore",
683+},
684+);
660685expect(child.kill).not.toHaveBeenCalled();
661686});
662687此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。