Ids.Test

_archivetesttypescript
Path: _archive/loom-stale-pre-sprint-snapshot/tests/ids.test.tsRelative: loom-stale-pre-sprint-snapshot/tests/ids.test.tsSubproject: _archiveCategory: archived
Lines: 47Bytes: 1,923Imports: 2Exports: 0has tests

Content Preview

  1. import { describe, expect, test } from "bun:test";
  2. import { actionHash, canonicalJSON, dispatchId, newEventId, newGoalId, newMemoryId, newStageId, sha256Hex } from "../src/lib/ids";
  3. describe("id generators match contract patterns", () => {
  4. test("prefixes and 12-char [a-z0-9] bodies", () => {
  5. expect(newGoalId()).toMatch(/^goal_[a-z0-9]{12}$/);
  6. expect(newStageId()).toMatch(/^stg_[a-z0-9]{12}$/);
  7. expect(newEventId()).toMatch(/^evt_[a-z0-9]{12}$/);
  8. expect(newMemoryId()).toMatch(/^