fix(審查流程): 修正 bot 跳過、JSON 驗證與排除比對邊界
This commit is contained in:
@@ -144,6 +144,21 @@ describe('findings exclusions', () => {
|
||||
assert.equal(filtered[0].location, 'README.md:12');
|
||||
});
|
||||
|
||||
it('applies pure text exclusions using the original finding text', () => {
|
||||
const findings = [
|
||||
{ location: 'src/app.ts:10', role: 'Maya', suggestion: 'Update tests' },
|
||||
{ location: 'src/app.ts:11', role: 'Maya', suggestion: 'Keep this' },
|
||||
];
|
||||
const exclusions = [
|
||||
{ original_finding: 'update tests' },
|
||||
];
|
||||
|
||||
const filtered = applyExclusions(findings, exclusions);
|
||||
|
||||
assert.equal(filtered.length, 1);
|
||||
assert.equal(filtered[0].suggestion, 'Keep this');
|
||||
});
|
||||
|
||||
it('dedupes repeated exclusions when loading exclusions', () => {
|
||||
const fullPath = path.join(workspace, EXCLUSIONS_PATH);
|
||||
fs.mkdirSync(path.dirname(fullPath), { recursive: true });
|
||||
|
||||
Reference in New Issue
Block a user