Ids.Test
Path:
loom-sprint-scaffold/loom/tests/ids.test.tsRelative: loom/tests/ids.test.tsSubproject: loom-sprint-scaffoldCategory: testsLines: 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(/^