mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-08 20:38:27 +00:00
refactor(gateway-test): share preview transcript fixture
This commit is contained in:
@@ -4,6 +4,7 @@ import path from "node:path";
|
||||
import { afterAll, beforeAll, beforeEach, describe, expect, test, vi } from "vitest";
|
||||
import { DEFAULT_PROVIDER } from "../agents/defaults.js";
|
||||
import { startGatewayServerHarness, type GatewayServerHarness } from "./server.e2e-ws-harness.js";
|
||||
import { createToolSummaryPreviewTranscriptLines } from "./session-preview.test-helpers.js";
|
||||
import {
|
||||
connectOk,
|
||||
embeddedRunMock,
|
||||
@@ -437,15 +438,7 @@ describe("gateway server sessions", () => {
|
||||
testState.sessionStorePath = storePath;
|
||||
const sessionId = "sess-preview";
|
||||
const transcriptPath = path.join(dir, `${sessionId}.jsonl`);
|
||||
const lines = [
|
||||
JSON.stringify({ type: "session", version: 1, id: sessionId }),
|
||||
JSON.stringify({ message: { role: "user", content: "Hello" } }),
|
||||
JSON.stringify({ message: { role: "assistant", content: "Hi" } }),
|
||||
JSON.stringify({
|
||||
message: { role: "assistant", content: [{ type: "toolcall", name: "weather" }] },
|
||||
}),
|
||||
JSON.stringify({ message: { role: "assistant", content: "Forecast ready" } }),
|
||||
];
|
||||
const lines = createToolSummaryPreviewTranscriptLines(sessionId);
|
||||
await fs.writeFile(transcriptPath, lines.join("\n"), "utf-8");
|
||||
|
||||
await writeSessionStore({
|
||||
|
||||
Reference in New Issue
Block a user