Skip to content

Commit f4fd3b1

Browse files
committed
test: add test case for allowAlphabet
1 parent c6a7ce2 commit f4fd3b1

File tree

2 files changed

+13
-2
lines changed

2 files changed

+13
-2
lines changed

src/create-index.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,6 @@ export const createIndex = async (): Promise<IndexType> => {
4848
}, {} as { [index: string]: SudachiSynonyms[] });
4949
const itemGroups = Object.values(groupByVocabularyNumber).filter(items => {
5050
return items.length > 1;
51-
5251
}).map(items => {
5352
return new ItemGroup(items);
5453
});

test/textlint-rule-no-synonyms.test.ts

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@ tester.run("textlint-rule-no-synonyms", rule, {
88
valid: [
99
"新参入、借り入れ、問題のパスポート、マネー、雇入 片方のペアだけならOKです",
1010
"This is アーカイブ",
11+
// allowAlphabet: true
12+
"blogはブログです",
1113
// allow links
1214
`「[インターフェース](https://example.com)」と「[インタフェース](https://example.com)」`,
1315
// "allows
@@ -24,5 +26,15 @@ tester.run("textlint-rule-no-synonyms", rule, {
2426
message: "同義語である「雇入」「雇入れ」が利用されています",
2527
index: 5
2628
}]
27-
}]
29+
},
30+
{
31+
text: "blogはブログです",
32+
options: {
33+
allowAlphabet: false
34+
},
35+
errors: [{
36+
message: "同義語である「blog」「ブログ」が利用されています",
37+
index: 5
38+
}]
39+
}]
2840
});

0 commit comments

Comments
 (0)