test: tighten temp home cleanup assertion · openclaw/openclaw@efee3f9
steipete
·
2026-05-10
·
via Recent Commits to openclaw:main
| Original file line number | Diff line number | Diff line change |
|---|
@@ -4,7 +4,13 @@ import { describe, expect, it } from "vitest";
|
4 | 4 | import { createTempHomeEnv } from "./temp-home.js"; |
5 | 5 | |
6 | 6 | async function expectPathMissing(targetPath: string): Promise<void> { |
7 | | -await expect(fs.stat(targetPath)).rejects.toMatchObject({ code: "ENOENT" }); |
| 7 | +try { |
| 8 | +await fs.stat(targetPath); |
| 9 | +} catch (error) { |
| 10 | +expect((error as NodeJS.ErrnoException).code).toBe("ENOENT"); |
| 11 | +return; |
| 12 | +} |
| 13 | +throw new Error(`expected ${targetPath} to be removed`); |
8 | 14 | } |
9 | 15 | |
10 | 16 | describe("createTempHomeEnv", () => { |
|
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。