docs(GOV-001): 建立工程治理与追溯规范
This commit is contained in:
@@ -0,0 +1,45 @@
|
||||
import assert from 'node:assert/strict';
|
||||
import test from 'node:test';
|
||||
|
||||
import {
|
||||
getFeatureDirectory,
|
||||
getRequiredFeatureFiles,
|
||||
validateFeatureId,
|
||||
} from './feature-record.mjs';
|
||||
|
||||
test('接受带业务域和三位序号的功能编号', () => {
|
||||
assert.equal(validateFeatureId('FEAT-MO-001'), true);
|
||||
assert.equal(validateFeatureId('GOV-001'), true);
|
||||
});
|
||||
|
||||
test('拒绝无法追溯或格式含糊的功能编号', () => {
|
||||
assert.equal(validateFeatureId('market-overview'), false);
|
||||
assert.equal(validateFeatureId('FEAT-MO-1'), false);
|
||||
assert.equal(validateFeatureId('../FEAT-MO-001'), false);
|
||||
});
|
||||
|
||||
test('将功能编号和短名称解析到固定的功能档案目录', () => {
|
||||
assert.equal(
|
||||
getFeatureDirectory('/repo', 'FEAT-MO-001', 'market-overview'),
|
||||
'/repo/docs/features/FEAT-MO-001-market-overview',
|
||||
);
|
||||
});
|
||||
|
||||
test('返回开发完成前必须存在的完整追溯文件清单', () => {
|
||||
assert.deepEqual(getRequiredFeatureFiles(), [
|
||||
'manifest.yaml',
|
||||
'requirements.md',
|
||||
'design.md',
|
||||
'implementation-plan.md',
|
||||
'test-plan.md',
|
||||
'gitnexus/before.md',
|
||||
'gitnexus/impact-plan.md',
|
||||
'gitnexus/detected-changes.md',
|
||||
'gitnexus/after.md',
|
||||
'gitnexus/comparison.md',
|
||||
'qa/test-results.md',
|
||||
'qa/visual-qa.md',
|
||||
'release-notes.md',
|
||||
'rollback.md',
|
||||
]);
|
||||
});
|
||||
Reference in New Issue
Block a user