fix(github): exclude issue source metadata
This commit is contained in:
1 parent
9118240cd4
commit
ad573b232c
2 files changed
+20
No files matched your search
@@ -8,6 +8,7 @@ import {
|
||||
rankCandidates,
|
||||
run,
|
||||
scoreCandidate,
|
||||
searchTerms,
|
||||
searchTitleTerms,
|
||||
} from "./suggest-similar-issues.mjs";
|
||||
|
||||
@@ -52,6 +53,23 @@ test("builds a short title query with identifiers split safely", () => {
|
||||
assert.doesNotMatch(query, /失效|弹出/u);
|
||||
});
|
||||
|
||||
test("excludes bot source metadata from searchable text", () => {
|
||||
const issue = {
|
||||
...baseIssue,
|
||||
body: `### 来源
|
||||
|
||||
QQ 群反馈 · **反馈人**:独特反馈人名称
|
||||
|
||||
### 原始描述
|
||||
|
||||
查询结果无法保存。`,
|
||||
};
|
||||
|
||||
const terms = searchTerms(issue);
|
||||
assert.doesNotMatch(terms, /QQ群反馈|独特反馈人名称/u);
|
||||
assert.match(terms, /查询结果无法保存/u);
|
||||
});
|
||||
|
||||
test("keeps compound Chinese product terms in the title query", () => {
|
||||
const query = searchTitleTerms({ title: "[Feature] 增加多列选中转置功能、增加转置列注释" });
|
||||
assert.match(query, /多列/u);
|
||||
|
||||
Reference in new issue
Block a user