1
0

fix: 修复 Windows 平台测试兼容性问题

- 新增 tests/helpers.ts 的 rmRetry 工具函数,解决 SQLite 文件句柄未及时释放导致 afterAll 清理时 EBUSY 错误
- 修改通配符测试用例,使用 bun -e 替代 echo 命令,确保跨平台行为一致
This commit is contained in:
2026-05-12 22:11:34 +08:00
parent ad87be6956
commit 87d946a441
6 changed files with 47 additions and 7 deletions

View File

@@ -119,7 +119,7 @@ describe("CommandChecker", () => {
test("不使用 shell通配符不被展开", async () => {
const result = await checker.execute(
makeTarget({ args: ["*"], exec: "echo" }, { expect: { stdout: [{ contains: "*" }] } }),
makeTarget({ args: ["-e", "console.log('*')"], exec: "bun" }, { expect: { stdout: [{ contains: "*" }] } }),
makeCtx(),
);
expect(result.matched).toBe(true);