Files
msd-core/tests/scan-command.test.cjs
Jakub Zych a9a7a328e6 refactor: hard-fork GSD -> MSD (Make Software Done)
Mechanical rename produced by scripts/msd-rename.cjs: gsd/Gsd/GSD -> msd/Msd/MSD
across contents and paths, upstream package/repo coordinates -> @golem15/msd-core
and golem15com/msd-core. Deep links into upstream history, sibling upstream
packages, the GSD-2 import feature, CHANGELOG.md and .changeset/ are kept as-is.

Hand edits on top: MSD block-letter banner and logos, LICENSE copyright line,
package/plugin identity, regenerated lockfile, install-tree fixtures, derived
registries and benchmark baseline; migration checksum baseline re-locked
(MSD keeps its own install state, so no install had applied the old sums);
sort-order and regex-escaped expectations in tests adjusted.
2026-10-06 01:47:40 +02:00

58 lines
2.6 KiB
JavaScript

// allow-test-rule: source-text-is-the-product
// Workflow .md / agent .md / command .md / reference .md files — their text
// IS what the runtime loads. Testing text content tests the deployed contract.
// Per CONTRIBUTING.md exception matrix.
const { describe, test } = require('node:test');
const assert = require('node:assert/strict');
const fs = require('fs');
const path = require('path');
// #2790: scan.md was consolidated into map-codebase.md as the --fast flag.
// The underlying workflow (workflows/scan.md) remains functional.
describe('scan command', () => {
test('scan is now a --fast flag on map-codebase.md (#2790)', () => {
const p = path.join(__dirname, '..', 'commands', 'msd', 'map-codebase.md');
assert.ok(fs.existsSync(p), 'commands/msd/map-codebase.md should exist');
const content = fs.readFileSync(p, 'utf-8');
assert.ok(content.includes('--fast'), 'map-codebase.md must document --fast flag (absorbed scan)');
assert.ok(content.includes('description:'), 'Command must have description frontmatter');
});
test('workflow file exists', () => {
const p = path.join(__dirname, '..', 'msd-core', 'workflows', 'scan.md');
assert.ok(fs.existsSync(p), 'msd-core/workflows/scan.md should exist');
});
test('workflow has focus-to-document mapping table', () => {
const p = path.join(__dirname, '..', 'msd-core', 'workflows', 'scan.md');
const content = fs.readFileSync(p, 'utf-8');
assert.ok(content.includes('Focus-to-Document Mapping') || content.includes('Focus | Documents'),
'Workflow should contain a focus-to-document mapping table');
});
test('all 5 focus areas are documented', () => {
const p = path.join(__dirname, '..', 'msd-core', 'workflows', 'scan.md');
const content = fs.readFileSync(p, 'utf-8');
const focusAreas = ['tech', 'arch', 'quality', 'concerns', 'tech+arch'];
for (const area of focusAreas) {
assert.ok(content.includes(`\`${area}\``),
`Workflow should document the "${area}" focus area`);
}
});
test('overwrite prompt is mentioned', () => {
const p = path.join(__dirname, '..', 'msd-core', 'workflows', 'scan.md');
const content = fs.readFileSync(p, 'utf-8');
assert.ok(content.includes('Overwrite') || content.includes('overwrite'),
'Workflow should mention overwrite prompt for existing documents');
});
test('workflow references msd-codebase-mapper', () => {
const p = path.join(__dirname, '..', 'msd-core', 'workflows', 'scan.md');
const content = fs.readFileSync(p, 'utf-8');
assert.ok(content.includes('msd-codebase-mapper'),
'Workflow should reference the msd-codebase-mapper agent');
});
});