test: tighten codex trajectory recorder assertion

This commit is contained in:
Peter Steinberger
2026-05-09 06:44:19 +01:00
parent c85aaa6e47
commit eb9f803ff1

View File

@@ -27,10 +27,10 @@ afterEach(() => {
function expectTrajectoryRecorder(
recorder: ReturnType<typeof createCodexTrajectoryRecorder>,
): CodexTrajectoryRecorder {
expect(recorder).toEqual(expect.objectContaining({ recordEvent: expect.any(Function) }));
if (recorder === null) {
throw new Error("Expected Codex trajectory recorder");
}
expect(typeof recorder.recordEvent).toBe("function");
return recorder;
}