
























@@ -213,14 +213,17 @@ describe("exportTrajectoryBundle", () => {
213213writeSimpleSessionFile(sessionFile);
214214fs.mkdirSync(outputDir);
215215216-await expect(
217-exportTrajectoryBundle({
216+try {
217+await exportTrajectoryBundle({
218218 outputDir,
219219 sessionFile,
220220sessionId: "session-1",
221221workspaceDir: tmpDir,
222-}),
223-).rejects.toMatchObject({ code: "EEXIST" });
222+});
223+throw new Error("expected trajectory export to reject an existing output directory");
224+} catch (error) {
225+expect((error as NodeJS.ErrnoException).code).toBe("EEXIST");
226+}
224227});
225228226229it("does not synthesize prompt files from export-time fallbacks", async () => {
@@ -748,9 +751,10 @@ describe("exportTrajectoryBundle", () => {
748751.trim()
749752.split(/\r?\n/u)
750753.map((line) => JSON.parse(line) as TrajectoryEvent);
751-expect(eventTypes(exportedEvents)).toEqual(
752-expect.arrayContaining(["tool.call", "tool.result", "context.compiled"]),
753-);
754+const types = eventTypes(exportedEvents);
755+expect(types).toContain("tool.call");
756+expect(types).toContain("tool.result");
757+expect(types).toContain("context.compiled");
754758expect(JSON.stringify(exportedEvents)).toContain("$WORKSPACE_DIR/inside.txt");
755759expect(JSON.stringify(exportedEvents)).not.toContain("$WORKSPACE_DIR2");
756760@@ -777,10 +781,8 @@ describe("exportTrajectoryBundle", () => {
777781const metadata = JSON.parse(fs.readFileSync(path.join(outputDir, "metadata.json"), "utf8")) as {
778782skills?: { entries?: Array<{ id?: string; invoked?: boolean }> };
779783};
780-expect(metadata.skills?.entries?.[0]).toMatchObject({
781-id: "weather",
782-invoked: true,
783-});
784+expect(metadata.skills?.entries?.[0]?.id).toBe("weather");
785+expect(metadata.skills?.entries?.[0]?.invoked).toBe(true);
784786const prompts = fs.readFileSync(path.join(outputDir, "prompts.json"), "utf8");
785787const artifacts = fs.readFileSync(path.join(outputDir, "artifacts.json"), "utf8");
786788const systemPrompt = fs.readFileSync(path.join(outputDir, "system-prompt.txt"), "utf8");
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。