testEntryName

tcmts.cli.main.testEntryName · #2kx55ils · term

import { entryName } from "#codebase/tcmts/cli/main";

export const testEntryName = () => {
  const eq = (a: string, b: string) => {
    if (a !== b) throw new Error(`${JSON.stringify(a)} isn't ${JSON.stringify(b)}`);
  };
  eq(entryName("update", ["lib.f"]), "update lib.f");
  eq(entryName("update", ["lib.f", "lib.g"]), "update lib.f, lib.g");
  eq(entryName("add", ["a.x", "b.y", "c.z", "d.w", "a.x"]), "add a.x, b.y (+2)");
  eq(entryName("update", [], "update scratch.ts"), "update scratch.ts");
}

uses