mirror of
https://github.com/openclaw/openclaw.git
synced 2026-04-15 03:01:02 +00:00
test(agent-events): use toMatchObject for context assertions
The new registeredAt and lastActiveAt fields on AgentRunContext cause toEqual to fail because it expects exact property counts. Switch to toMatchObject which validates expected properties without requiring exact match — the standard pattern for objects with auto-injected timestamps. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -107,7 +107,7 @@ describe("agent-events sequencing", () => {
|
||||
isHeartbeat: true,
|
||||
});
|
||||
|
||||
expect(getAgentRunContext("run-ctx")).toEqual({
|
||||
expect(getAgentRunContext("run-ctx")).toMatchObject({
|
||||
sessionKey: "session-main",
|
||||
verboseLevel: "full",
|
||||
isHeartbeat: true,
|
||||
@@ -186,7 +186,7 @@ describe("agent-events sequencing", () => {
|
||||
|
||||
stop();
|
||||
|
||||
expect(second.getAgentRunContext("run-dup")).toEqual({ sessionKey: "session-dup" });
|
||||
expect(second.getAgentRunContext("run-dup")).toMatchObject({ sessionKey: "session-dup" });
|
||||
expect(seen).toEqual([
|
||||
{ seq: 1, sessionKey: "session-dup" },
|
||||
{ seq: 2, sessionKey: "session-dup" },
|
||||
|
||||
Reference in New Issue
Block a user