test(plugin-sdk): isolate runtime facade tests · openclaw/openclaw@061a370
vincentkoc
·
2026-06-20
·
via Recent Commits to openclaw:main
| Original file line number | Diff line number | Diff line change |
|---|
|
1 | 1 | /** |
2 | 2 | * Preflight tests for Anthropic Vertex auth presence helpers. |
3 | 3 | */ |
4 | | -import { afterEach, describe, expect, it, vi } from "vitest"; |
| 4 | +import { afterEach, beforeEach, describe, expect, it, vi } from "vitest"; |
5 | 5 | |
6 | 6 | const { existsSyncMock, readFileSyncMock } = vi.hoisted(() => ({ |
7 | 7 | existsSyncMock: vi.fn(), |
@@ -28,17 +28,20 @@ vi.mock("node:fs", async () => {
|
28 | 28 | }; |
29 | 29 | }); |
30 | 30 | |
31 | | -import { hasAnthropicVertexAvailableAuth } from "./anthropic-vertex-auth-presence.js"; |
32 | | - |
33 | 31 | describe("hasAnthropicVertexAvailableAuth ADC preflight", () => { |
| 32 | +beforeEach(() => { |
| 33 | +vi.resetModules(); |
| 34 | +}); |
| 35 | + |
34 | 36 | afterEach(() => { |
35 | 37 | existsSyncMock.mockClear(); |
36 | 38 | readFileSyncMock.mockClear(); |
37 | 39 | }); |
38 | 40 | |
39 | | -it("reads explicit ADC credentials without an existsSync preflight", () => { |
| 41 | +it("reads explicit ADC credentials without an existsSync preflight", async () => { |
40 | 42 | existsSyncMock.mockClear(); |
41 | 43 | readFileSyncMock.mockClear(); |
| 44 | +const { hasAnthropicVertexAvailableAuth } = await import("./anthropic-vertex-auth-presence.js"); |
42 | 45 | |
43 | 46 | expect( |
44 | 47 | hasAnthropicVertexAvailableAuth({ |
|
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。