testPackCarriesItsOwnCopy

tcmts.cli.test.e2e.releases.testPackCarriesItsOwnCopy · #ta7aspu4 · term

what a package has its own name for is its own, even where another package has the same definition

import { codebase } from "#codebase/tcmts/cli/test/e2e/releases";
import assert from "node:assert/strict";
import fs from "node:fs";
import path from "node:path";

export const testPackCarriesItsOwnCopy = () => {
  const a = codebase("copies");
  a.save(`// tcm: namespace geo\nexport const manifest = { name: "geo" };\nexport type Unit = "m" | "km";\n`, "add");
  a.save(`// tcm: namespace atlas\nexport const manifest = { name: "atlas" };\nexport type Unit = "m" | "km";\nexport const label = (u: Unit): string => \`in \${u}\`;\n`, "add");
  assert.doesNotMatch(a.tcm("pack", "atlas"), /depends on/);
  const dir = path.join(a.dir, ".tcm", "pack", "atlas");
  assert.deepEqual(JSON.parse(fs.readFileSync(path.join(dir, "package.json"), "utf8")).dependencies, {});
}

uses