test: tighten state dir env assertion · openclaw/openclaw@96d68c4
steipete
·
2026-05-10
·
via Recent Commits to openclaw:main
| Original file line number | Diff line number | Diff line change |
|---|
@@ -23,7 +23,12 @@ function expectStateDirVars(snapshot: EnvSnapshot) {
|
23 | 23 | } |
24 | 24 | |
25 | 25 | async function expectPathMissing(filePath: string) { |
26 | | -await expect(fs.stat(filePath)).rejects.toMatchObject({ code: "ENOENT" }); |
| 26 | +try { |
| 27 | +await fs.stat(filePath); |
| 28 | +throw new Error(`Expected ${filePath} to be missing`); |
| 29 | +} catch (error) { |
| 30 | +expect((error as NodeJS.ErrnoException).code).toBe("ENOENT"); |
| 31 | +} |
27 | 32 | } |
28 | 33 | |
29 | 34 | async function expectStateDirEnvRestored(params: { |
|
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。