testRemapHashes

tcmts.cli.migrate.testRemapHashes · #3y6o472t · term

import { remapHashes } from "#codebase/tcmts/cli/migrate";
import assert from "node:assert/strict";

export const testRemapHashes = () => {
  const a = "a".repeat(52),
    b = "b".repeat(52);
  assert.deepEqual(
    remapHashes(
      { hash: a, spans: [{ hash: a, start: 1 }], ref: `#${a}`, other: "x" },
      new Map([[a, b]]),
    ),
    { hash: b, spans: [{ hash: b, start: 1 }], ref: `#${b}`, other: "x" },
  );
}

uses