testSavingOverAConflictResolvesIt
A definition saved from a scratch file at a conflicted name (written by hand, not tcm edit's) resolves the
conflict to it, in one step: no tcm resolve first.
import { withConflicts } from "#codebase/tcmts/cli/test/e2e/merge"; import assert from "node:assert/strict"; import fs from "node:fs"; import path from "node:path"; export const testSavingOverAConflictResolvesIt = () => { const { dir, tcm } = withConflicts("merge save over"); fs.writeFileSync( path.join(dir, "scratch.ts"), `// tcm: namespace lib\nexport const k = (): number => 7;\n`, ); const saved = tcm("update"); assert.match(saved, /resolves +lib\.k/); assert.doesNotMatch(tcm("todo"), /conflict lib\.k|unnamed version/); assert.match(tcm("resolve", "lib.m", "--theirs"), /lib\.m →/); assert.equal(tcm("run", "lib.user").trim(), String((7 + 3) * 10)); assert.match(tcm("todo"), /nothing to do/); }