test: tighten private qa cli module assertions · openclaw/openclaw@e3f336c
steipete
·
2026-05-09
·
via Recent Commits to openclaw:main
| Original file line number | Diff line number | Diff line change |
|---|
@@ -29,11 +29,13 @@ describe("private-qa-cli", () => {
|
29 | 29 | path.join(repoRoot, "dist", "plugin-sdk", "qa-lab.js"), |
30 | 30 | ]); |
31 | 31 | let importedSpecifier: string | undefined; |
| 32 | +const isQaLabCliAvailable = vi.fn(); |
| 33 | +const registerQaLabCli = vi.fn(); |
32 | 34 | const importModule = vi.fn(async (specifier: string) => { |
33 | 35 | importedSpecifier = specifier; |
34 | 36 | return { |
35 | | -isQaLabCliAvailable: expect.any(Function), |
36 | | -registerQaLabCli: expect.any(Function), |
| 37 | + isQaLabCliAvailable, |
| 38 | + registerQaLabCli, |
37 | 39 | }; |
38 | 40 | }); |
39 | 41 | |
@@ -45,10 +47,8 @@ describe("private-qa-cli", () => {
|
45 | 47 | |
46 | 48 | expect(importModule).toHaveBeenCalledTimes(1); |
47 | 49 | expect(importedSpecifier).toContain("/dist/plugin-sdk/qa-lab.js"); |
48 | | -expect(module).toMatchObject({ |
49 | | -isQaLabCliAvailable: expect.any(Function), |
50 | | -registerQaLabCli: expect.any(Function), |
51 | | -}); |
| 50 | +expect(module.isQaLabCliAvailable).toBe(isQaLabCliAvailable); |
| 51 | +expect(module.registerQaLabCli).toBe(registerQaLabCli); |
52 | 52 | }); |
53 | 53 | |
54 | 54 | it("rejects non-source package roots even when private QA is enabled", () => { |
|
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。