Skip to content

Commit 7ebcdee

Browse files
committed
Add test
1 parent f5b1e48 commit 7ebcdee

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

test/no-generic-link-text.test.js

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,17 @@ describe("GH002: No Generic Link Text", () => {
4949
}
5050
});
5151

52+
test("error message", async () => {
53+
const strings = ["[Click here](www.github.com)"];
54+
55+
const results = await runTest(strings, noGenericLinkTextRule);
56+
57+
expect(results[0].ruleDescription).toMatch(
58+
/Avoid using generic link text like `Learn more` or `Click here`/
59+
);
60+
expect(results[0].errorDetail).toBe("For link: Click here");
61+
});
62+
5263
test("additional words can be configured", async () => {
5364
const results = await runTest(
5465
["[something](www.github.com)"],

0 commit comments

Comments
 (0)