test(config): add config-get/set roundtrip and cross-workflow structural tests for use_worktrees
Add comprehensive test coverage for the workflow.use_worktrees config toggle: - config-get returns false after setting to false (roundtrip verification) - config-get errors with "Key not found" when not set (validates workflow fallback behavior where `|| echo "true"` provides the default) - config-get returns true after setting to true - Toggle back and forth works correctly - Structural tests verify USE_WORKTREES is wired into quick.md, diagnose-issues.md, execute-plan.md, planning-config.md, and config.cjs Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -122,3 +122,63 @@ describe('execute-phase docs: user-facing wave flag', () => {
|
||||
);
|
||||
});
|
||||
});
|
||||
|
||||
describe('use_worktrees config: cross-workflow structural coverage', () => {
|
||||
const QUICK_PATH = path.join(__dirname, '..', 'get-shit-done', 'workflows', 'quick.md');
|
||||
const DIAGNOSE_PATH = path.join(__dirname, '..', 'get-shit-done', 'workflows', 'diagnose-issues.md');
|
||||
const EXECUTE_PLAN_PATH = path.join(__dirname, '..', 'get-shit-done', 'workflows', 'execute-plan.md');
|
||||
const PLANNING_CONFIG_PATH = path.join(__dirname, '..', 'get-shit-done', 'references', 'planning-config.md');
|
||||
const CONFIG_CJS_PATH = path.join(__dirname, '..', 'get-shit-done', 'bin', 'lib', 'config.cjs');
|
||||
|
||||
test('quick workflow reads USE_WORKTREES from config', () => {
|
||||
const content = fs.readFileSync(QUICK_PATH, 'utf-8');
|
||||
assert.ok(
|
||||
content.includes('config-get workflow.use_worktrees'),
|
||||
'quick.md should read use_worktrees from config'
|
||||
);
|
||||
assert.ok(
|
||||
content.includes('USE_WORKTREES'),
|
||||
'quick.md should reference USE_WORKTREES variable'
|
||||
);
|
||||
});
|
||||
|
||||
test('diagnose-issues workflow reads USE_WORKTREES from config', () => {
|
||||
const content = fs.readFileSync(DIAGNOSE_PATH, 'utf-8');
|
||||
assert.ok(
|
||||
content.includes('config-get workflow.use_worktrees'),
|
||||
'diagnose-issues.md should read use_worktrees from config'
|
||||
);
|
||||
assert.ok(
|
||||
content.includes('USE_WORKTREES'),
|
||||
'diagnose-issues.md should reference USE_WORKTREES variable'
|
||||
);
|
||||
});
|
||||
|
||||
test('execute-plan workflow references use_worktrees config', () => {
|
||||
const content = fs.readFileSync(EXECUTE_PLAN_PATH, 'utf-8');
|
||||
assert.ok(
|
||||
content.includes('workflow.use_worktrees'),
|
||||
'execute-plan.md should reference workflow.use_worktrees'
|
||||
);
|
||||
});
|
||||
|
||||
test('planning-config reference documents use_worktrees', () => {
|
||||
const content = fs.readFileSync(PLANNING_CONFIG_PATH, 'utf-8');
|
||||
assert.ok(
|
||||
content.includes('workflow.use_worktrees'),
|
||||
'planning-config.md should document workflow.use_worktrees'
|
||||
);
|
||||
assert.ok(
|
||||
content.includes('worktree'),
|
||||
'planning-config.md should describe worktree behavior'
|
||||
);
|
||||
});
|
||||
|
||||
test('config.cjs includes workflow.use_worktrees in VALID_CONFIG_KEYS', () => {
|
||||
const content = fs.readFileSync(CONFIG_CJS_PATH, 'utf-8');
|
||||
assert.ok(
|
||||
content.includes("'workflow.use_worktrees'"),
|
||||
'config.cjs VALID_CONFIG_KEYS should include workflow.use_worktrees'
|
||||
);
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user