Ids.Test
Path:
_archive/loom-stale-pre-sprint-snapshot/tests/ids.test.tsRelative: loom-stale-pre-sprint-snapshot/tests/ids.test.tsSubproject: _archiveCategory: archivedLines: 47Bytes: 1,923Imports: 2Exports: 0has tests
Content Preview
- import { describe, expect, test } from "bun:test";
- import { actionHash, canonicalJSON, dispatchId, newEventId, newGoalId, newMemoryId, newStageId, sha256Hex } from "../src/lib/ids";
- describe("id generators match contract patterns", () => {
- test("prefixes and 12-char [a-z0-9] bodies", () => {
- expect(newGoalId()).toMatch(/^goal_[a-z0-9]{12}$/);
- expect(newStageId()).toMatch(/^stg_[a-z0-9]{12}$/);
- expect(newEventId()).toMatch(/^evt_[a-z0-9]{12}$/);
- expect(newMemoryId()).toMatch(/^