Skip to content

Commit 90c0f7f

Browse files
committed
test: add tests
1 parent 4e1026e commit 90c0f7f

File tree

2 files changed

+11
-1
lines changed

2 files changed

+11
-1
lines changed

src/textlint-rule-no-synonyms.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ export const DefaultOptions: Required<Options> = {
3838

3939
const report: TextlintRuleReporter<Options> = (context, options = {}) => {
4040
const allowAlphabet = options.allowAlphabet ?? DefaultOptions.allowAlphabet;
41-
const allowNumber = options.allowAlphabet ?? DefaultOptions.allowNumber;
41+
const allowNumber = options.allowNumber ?? DefaultOptions.allowNumber;
4242
const allows = options.allows !== undefined ? options.allows : DefaultOptions.allows;
4343
const { Syntax, getSource, RuleError } = context;
4444
const usedSudachiSynonyms: Set<SudachiSynonyms> = new Set();

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

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,5 +48,15 @@ tester.run("textlint-rule-no-synonyms", rule, {
4848
message: "同義語である「blog」と「ブログ」が利用されています",
4949
index: 5
5050
}]
51+
},
52+
{
53+
text: "1は数字の一種です",
54+
options: {
55+
allowNumber: false
56+
},
57+
errors: [{
58+
message: "同義語である「1」と「一」が利用されています",
59+
index: 5
60+
}]
5161
}]
5262
});

0 commit comments

Comments
 (0)