test: tighten openclaw test instance assertions · openclaw/openclaw@ad75cb6
steipete
·
2026-05-09
·
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 { createOpenClawTestInstance } from "./openclaw-test-instance.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 missing path: ${targetPath}`); |
8 | 14 | } |
9 | 15 | |
10 | 16 | describe("openclaw test instance", () => { |
@@ -35,7 +41,7 @@ describe("openclaw test instance", () => {
|
35 | 41 | expect(inst.env.OPENCLAW_SKIP_CRON).toBe("0"); |
36 | 42 | |
37 | 43 | const config = JSON.parse(await fs.readFile(inst.configPath, "utf8")); |
38 | | -expect(config).toMatchObject({ |
| 44 | +expect(config).toStrictEqual({ |
39 | 45 | gateway: { |
40 | 46 | bind: "loopback", |
41 | 47 | port: inst.port, |
|
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。