// tests/commands/trekplan.test.mjs // Prose-pin tests for /trekplan. import { test } from 'node:test'; import { strict as assert } from 'node:assert'; import { readFileSync } from 'node:fs'; import { dirname, join } from 'node:path'; import { fileURLToPath } from 'node:url'; const HERE = dirname(fileURLToPath(import.meta.url)); const ROOT = join(HERE, '..', '..'); const COMMAND_FILE = join(ROOT, 'commands', 'trekplan.md'); function read() { return readFileSync(COMMAND_FILE, 'utf8'); } // --- S31 / V15: export trim — drop pr|issue|markdown, keep headless as a --decompose alias --- test('trekplan — V15: pr/issue/markdown export variants are removed', () => { const text = read(); // No remaining `--export pr` usage/example anywhere in the command. assert.equal(/--export\s+pr\b/.test(text), false, '`--export pr` must be gone'); // The per-format subsections of the old Export phase must be deleted. assert.ok(!text.includes('Format: `pr`'), 'pr export-format section must be gone'); assert.ok(!text.includes('Format: `issue`'), 'issue export-format section must be gone'); assert.ok(!text.includes('Format: `markdown`'), 'markdown export-format section must be gone'); }); test('trekplan — V15: --export headless survives as a --decompose alias', () => { const text = read(); assert.match(text, /--export\s+headless/, '`--export headless` must remain documented'); assert.match(text, /alias for [`*]*--decompose/i, '`--export headless` must be labeled an alias for --decompose'); });