test: reuse memory post json imports · openclaw/openclaw@7c27a51
shakkernerd
·
2026-05-10
·
via Recent Commits to openclaw:main
File tree
packages/memory-host-sdk/src/host
| Original file line number | Diff line number | Diff line change |
|---|
|
1 | 1 | import { beforeEach, describe, expect, it, vi } from "vitest"; |
| 2 | +import { postJson } from "./post-json.js"; |
| 3 | +import { withRemoteHttpResponse } from "./remote-http.js"; |
2 | 4 | |
3 | 5 | vi.mock("./remote-http.js", () => ({ |
4 | 6 | withRemoteHttpResponse: vi.fn(), |
5 | 7 | })); |
6 | 8 | |
7 | | -const { postJson } = await import("./post-json.js"); |
8 | | -const { withRemoteHttpResponse } = await import("./remote-http.js"); |
9 | 9 | const remoteHttpMock = vi.mocked(withRemoteHttpResponse); |
10 | 10 | |
11 | 11 | function jsonResponse(payload: unknown, status = 200): Response { |
|
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。