test: tighten windows exec assertions · openclaw/openclaw@3cebb01
shakkernerd
·
2026-05-11
·
via Recent Commits to openclaw:main
| Original file line number | Diff line number | Diff line change |
|---|
@@ -480,7 +480,7 @@ describe("windows command wrapper behavior", () => {
|
480 | 480 | expect(spawnMock).toHaveBeenCalledTimes(2); |
481 | 481 | expect(spawnMock.mock.calls[1]?.[0]).toBe("taskkill"); |
482 | 482 | expect(spawnMock.mock.calls[1]?.[1]).toEqual(["/PID", "1234", "/T", "/F"]); |
483 | | -expect(spawnMock.mock.calls[1]?.[2]).toMatchObject({ |
| 483 | +expect(spawnMock.mock.calls[1]?.[2]).toEqual({ |
484 | 484 | stdio: "ignore", |
485 | 485 | windowsHide: true, |
486 | 486 | }); |
@@ -537,8 +537,9 @@ describe("windows command wrapper behavior", () => {
|
537 | 537 | ); |
538 | 538 | |
539 | 539 | try { |
540 | | -await expect(runExec("node", ["utf8-output.js"], 1000)).resolves.toMatchObject({ |
| 540 | +await expect(runExec("node", ["utf8-output.js"], 1000)).resolves.toEqual({ |
541 | 541 | stdout: "测试", |
| 542 | +stderr: "", |
542 | 543 | }); |
543 | 544 | } finally { |
544 | 545 | platformSpy.mockRestore(); |
@@ -561,8 +562,15 @@ describe("windows command wrapper behavior", () => {
|
561 | 562 | try { |
562 | 563 | await expect( |
563 | 564 | runCommandWithTimeout(["node", "gbk-output.js"], { timeoutMs: 1000 }), |
564 | | -).resolves.toMatchObject({ |
| 565 | +).resolves.toEqual({ |
| 566 | +pid: 1234, |
565 | 567 | stdout: "测试", |
| 568 | +stderr: "", |
| 569 | +code: 0, |
| 570 | +signal: null, |
| 571 | +killed: false, |
| 572 | +termination: "exit", |
| 573 | +noOutputTimedOut: false, |
566 | 574 | }); |
567 | 575 | } finally { |
568 | 576 | platformSpy.mockRestore(); |
|
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。