Skip to content

Commit 3002c41

Browse files
committed
chore(npm): update textlint and test
1 parent 9f74f53 commit 3002c41

File tree

2 files changed

+43
-1
lines changed

2 files changed

+43
-1
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@
4141
"espower-babel": "^3.3.0",
4242
"mocha": "^2.3.2",
4343
"power-assert": "^1.0.0",
44-
"textlint": "^5.5.3"
44+
"textlint": "^6.0.1"
4545
},
4646
"peerDependencies": {
4747
"textlint": ">= 5.5.0"

test/prh-rule-tester-test.js

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
// LICENSE : MIT
2+
"use strict";
3+
var TextLintTester = require("textlint-tester");
4+
var tester = new TextLintTester();
5+
// rule
6+
import rule from "../src/prh-rule";
7+
// ruleName, rule, { valid, invalid }
8+
tester.run("prh", rule, {
9+
valid: [
10+
{
11+
text: "JavaScript library",
12+
options: {
13+
rulePaths: [__dirname + "/fixtures/rule.yaml"]
14+
}
15+
}
16+
],
17+
invalid: [
18+
{
19+
text: "cookie is a data.\n" +
20+
"texlint check your texts.\n" +
21+
"jquery is libray.\n",
22+
output: "Cookie is a data.\n" +
23+
"texlint check your texts.\n" +
24+
"jQuery is libray.\n",
25+
options: {
26+
"rulePaths": [__dirname + "/fixtures/rule.yaml"]
27+
},
28+
errors: [
29+
{
30+
message: "cookie => Cookie",
31+
line: 1,
32+
column: 1
33+
},
34+
{
35+
message: "jquery => jQuery",
36+
line: 3,
37+
column: 1
38+
}
39+
]
40+
}
41+
]
42+
});

0 commit comments

Comments
 (0)