2026-08-11 18:34:32 +08:00
|
|
|
import { expect, it } from "vitest";
|
|
|
|
|
|
|
|
|
|
import { createProcessCaptureJournal } from "./ProcessCaptureJournal.js";
|
|
|
|
|
|
2026-10-05 21:15:04 +08:00
|
|
|
it("records capture events in monotonic observation order", () => {
|
2026-08-11 18:34:32 +08:00
|
|
|
const journal = createProcessCaptureJournal();
|
2026-10-05 21:15:04 +08:00
|
|
|
journal.recordEvent("filesystem_checkpoints", 0);
|
2026-08-11 18:34:32 +08:00
|
|
|
journal.recordEvent("lifecycle", 0);
|
|
|
|
|
journal.recordEvent("frames", 0);
|
2026-10-05 21:15:04 +08:00
|
|
|
journal.recordEvent("filesystem_checkpoints", 1);
|
2026-08-11 18:34:32 +08:00
|
|
|
|
|
|
|
|
expect(journal.entries).toEqual([
|
2026-10-05 21:15:04 +08:00
|
|
|
{ capture_order: 0, collection: "filesystem_checkpoints", index: 0 },
|
|
|
|
|
{ capture_order: 1, collection: "lifecycle", index: 0 },
|
2026-08-11 18:34:32 +08:00
|
|
|
{ capture_order: 2, collection: "frames", index: 0 },
|
2026-10-05 21:15:04 +08:00
|
|
|
{ capture_order: 3, collection: "filesystem_checkpoints", index: 1 },
|
2026-08-11 18:34:32 +08:00
|
|
|
]);
|
|
|
|
|
});
|