86 lines
3.5 KiB
JavaScript
86 lines
3.5 KiB
JavaScript
const test = require('node:test');
|
|
const assert = require('node:assert/strict');
|
|
const fs = require('node:fs');
|
|
const path = require('node:path');
|
|
|
|
const root = path.resolve(__dirname, '..', '..');
|
|
|
|
function readWorkspaceFile(...parts) {
|
|
return fs.readFileSync(path.join(root, ...parts), 'utf8');
|
|
}
|
|
|
|
test('dispatcher docs describe the task-driven team_single executor', () => {
|
|
const docs = readWorkspaceFile('docs', 'ERP任务调度器说明.md');
|
|
|
|
assert.match(docs, /tools\/erp_team_single_executor\.js/);
|
|
assert.match(docs, /tools\/erp_team_single_browser_operations\.js/);
|
|
assert.match(docs, /team_single_operations_missing/);
|
|
assert.match(docs, /executors\.teamSingle\.enabled/);
|
|
assert.match(docs, /teamSingleProducts/);
|
|
});
|
|
|
|
test('dispatcher docs describe the task-driven split_parent executor', () => {
|
|
const docs = readWorkspaceFile('docs', 'ERP任务调度器说明.md');
|
|
|
|
assert.match(docs, /tools\/erp_split_parent_executor\.js/);
|
|
assert.match(docs, /tools\/erp_split_parent_browser_operations\.js/);
|
|
assert.match(docs, /split_parent_operations_missing/);
|
|
assert.match(docs, /executors\.splitParent\.enabled/);
|
|
assert.match(docs, /splitParentProducts/);
|
|
});
|
|
|
|
test('dispatcher docs describe the task-driven split_child executor', () => {
|
|
const docs = readWorkspaceFile('docs', 'ERP任务调度器说明.md');
|
|
|
|
assert.match(docs, /tools\/erp_split_child_executor\.js/);
|
|
assert.match(docs, /tools\/erp_split_child_browser_operations\.js/);
|
|
assert.match(docs, /split_child_operations_missing/);
|
|
assert.match(docs, /executors\.splitChild\.enabled/);
|
|
assert.match(docs, /splitChildCustomers/);
|
|
});
|
|
|
|
test('deployment docs include the team_single enablement gate', () => {
|
|
const docs = readWorkspaceFile('docs', '部署-龙虾盒爱马仕.md');
|
|
|
|
assert.match(docs, /tools\/erp_team_single_executor\.js/);
|
|
assert.match(docs, /tools\/erp_team_single_browser_operations\.js/);
|
|
assert.match(docs, /executors\.teamSingle\.enabled/);
|
|
assert.match(docs, /teamSingleProducts/);
|
|
});
|
|
|
|
test('deployment docs include the split_parent enablement gate', () => {
|
|
const docs = readWorkspaceFile('docs', '部署-龙虾盒爱马仕.md');
|
|
|
|
assert.match(docs, /tools\/erp_split_parent_executor\.js/);
|
|
assert.match(docs, /tools\/erp_split_parent_browser_operations\.js/);
|
|
assert.match(docs, /executors\.splitParent\.enabled/);
|
|
assert.match(docs, /splitParentProducts/);
|
|
});
|
|
|
|
test('deployment docs include the split_child enablement gate', () => {
|
|
const docs = readWorkspaceFile('docs', '部署-龙虾盒爱马仕.md');
|
|
|
|
assert.match(docs, /tools\/erp_split_child_executor\.js/);
|
|
assert.match(docs, /tools\/erp_split_child_browser_operations\.js/);
|
|
assert.match(docs, /executors\.splitChild\.enabled/);
|
|
assert.match(docs, /splitChildCustomers/);
|
|
});
|
|
|
|
test('dispatcher plan marks team_single refactor complete', () => {
|
|
const plan = readWorkspaceFile('docs', 'superpowers', 'plans', '2026-06-18-erp-task-dispatcher.md');
|
|
|
|
assert.match(plan, /- \[x\] Refactor `team_single` executor to consume task JSON\./);
|
|
});
|
|
|
|
test('dispatcher plan marks split_parent refactor complete', () => {
|
|
const plan = readWorkspaceFile('docs', 'superpowers', 'plans', '2026-06-18-erp-task-dispatcher.md');
|
|
|
|
assert.match(plan, /- \[x\] Refactor `split_parent` executor to consume task JSON\./);
|
|
});
|
|
|
|
test('dispatcher plan marks split_child refactor complete', () => {
|
|
const plan = readWorkspaceFile('docs', 'superpowers', 'plans', '2026-06-18-erp-task-dispatcher.md');
|
|
|
|
assert.match(plan, /- \[x\] Refactor `split_child` executor to consume task JSON\./);
|
|
});
|