test: dedupe qa matrix absence assertions · openclaw/openclaw@737d525
steipete
·
2026-05-09
·
via Recent Commits to openclaw:main
| Original file line number | Diff line number | Diff line change |
|---|
@@ -68,6 +68,10 @@ function requireMatrixQaScenario(id: string): (typeof MATRIX_QA_SCENARIOS)[numbe
|
68 | 68 | return scenario; |
69 | 69 | } |
70 | 70 | |
| 71 | +async function expectPathMissing(targetPath: string): Promise<void> { |
| 72 | +await expect(stat(targetPath)).rejects.toMatchObject({ code: "ENOENT" }); |
| 73 | +} |
| 74 | + |
71 | 75 | function matrixQaScenarioContext(): MatrixQaScenarioContext { |
72 | 76 | return { |
73 | 77 | baseUrl: "http://127.0.0.1:28008/", |
@@ -1984,7 +1988,7 @@ describe("matrix live qa scenarios", () => {
|
1984 | 1988 | }, |
1985 | 1989 | }); |
1986 | 1990 | |
1987 | | -await expect(stat(syncStorePath)).rejects.toThrow(); |
| 1991 | +await expectPathMissing(syncStorePath); |
1988 | 1992 | expect(registerWithToken).toHaveBeenCalledWith( |
1989 | 1993 | expect.objectContaining({ |
1990 | 1994 | registrationToken: "registration-token", |
@@ -4818,8 +4822,8 @@ describe("matrix live qa scenarios", () => {
|
4818 | 4822 | startupVerification: "off", |
4819 | 4823 | userId: "@cli-owner:matrix-qa.test", |
4820 | 4824 | }); |
4821 | | -await expect(readFile(configPath, "utf8")).rejects.toThrow(); |
4822 | | -await expect(readdir(String(cliEnv?.OPENCLAW_STATE_DIR))).rejects.toThrow(); |
| 4825 | +await expectPathMissing(configPath); |
| 4826 | +await expectPathMissing(String(cliEnv?.OPENCLAW_STATE_DIR)); |
4823 | 4827 | expect(acceptVerification).toHaveBeenCalledWith("owner-request"); |
4824 | 4828 | expect(confirmVerificationSas).toHaveBeenCalledWith("owner-request"); |
4825 | 4829 | expect(deleteOwnDevices).toHaveBeenCalledWith(["CLIDEVICE"]); |
|
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。