test: tighten trajectory recorder assertion

This commit is contained in:
Peter Steinberger
2026-05-09 04:04:38 +01:00
parent e110b09b9f
commit 1c19ce4e1b

View File

@@ -30,10 +30,10 @@ afterEach(() => {
function expectTrajectoryRuntimeRecorder(
recorder: ReturnType<typeof createTrajectoryRuntimeRecorder>,
): TrajectoryRuntimeRecorder {
expect(recorder).toEqual(expect.objectContaining({ recordEvent: expect.any(Function) }));
if (recorder === null) {
throw new Error("Expected trajectory runtime recorder");
}
expect(typeof recorder.recordEvent).toBe("function");
return recorder;
}