mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-15 03:40:46 +00:00
test: tighten session fork assertions
This commit is contained in:
@@ -286,10 +286,12 @@ describe("forkSessionFromParentRuntime", () => {
|
||||
sessionsDir,
|
||||
});
|
||||
|
||||
expect(fork).not.toBeNull();
|
||||
expect(fork?.sessionFile).toContain(sessionsDir);
|
||||
expect(fork?.sessionId).not.toBe(parentSessionId);
|
||||
const raw = await fs.readFile(fork?.sessionFile ?? "", "utf-8");
|
||||
if (fork === null) {
|
||||
throw new Error("Expected forked session");
|
||||
}
|
||||
expect(fork.sessionFile).toContain(sessionsDir);
|
||||
expect(fork.sessionId).not.toBe(parentSessionId);
|
||||
const raw = await fs.readFile(fork.sessionFile, "utf-8");
|
||||
const forkedEntries = raw
|
||||
.trim()
|
||||
.split(/\r?\n/u)
|
||||
@@ -297,7 +299,7 @@ describe("forkSessionFromParentRuntime", () => {
|
||||
const resolvedParentSessionFile = await fs.realpath(parentSessionFile);
|
||||
expect(forkedEntries[0]).toMatchObject({
|
||||
type: "session",
|
||||
id: fork?.sessionId,
|
||||
id: fork.sessionId,
|
||||
cwd,
|
||||
parentSession: resolvedParentSessionFile,
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user