Skip to content

Commit 3a2ce49

Browse files
committed
Fix test
1 parent 7c5aef4 commit 3a2ce49

File tree

1 file changed

+14
-25
lines changed

1 file changed

+14
-25
lines changed

test/accessibility-rules.test.js

Lines changed: 14 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,34 +1,23 @@
1+
import { readFile } from "fs/promises";
12
import { lint } from "markdownlint/async";
2-
import { githubMarkdownLint } from "../src/rules";
3+
import githubMarkdownLint from "../index.js";
34

45
const exampleFileName = "./test/example.md";
5-
const options = {
6-
config: {
7-
"no-duplicate-heading": true,
8-
"ol-prefix": "ordered",
9-
"no-space-in-links": false,
10-
"single-h1": true,
11-
"no-emphasis-as-heading": true,
12-
"no-empty-alt-text": false,
13-
"heading-increment": true,
14-
"no-generic-link-text": true,
15-
"ul-style": {
16-
style: "asterisk",
17-
},
18-
default: false,
19-
"no-inline-html": false,
20-
"no-bare-urls": false,
21-
"no-blanks-blockquote": false,
22-
"fenced-code-language": true,
23-
"no-default-alt-text": true,
24-
"no-alt-text": true,
25-
},
26-
files: [exampleFileName],
27-
customRules: githubMarkdownLint,
28-
};
296

307
describe("when A11y rules applied", () => {
318
test("fails expected rules", async () => {
9+
const accessibilityRules = JSON.parse(
10+
await readFile(new URL("../style/accessibility.json", import.meta.url)),
11+
);
12+
const options = {
13+
config: {
14+
default: false,
15+
...accessibilityRules,
16+
},
17+
files: [exampleFileName],
18+
customRules: githubMarkdownLint,
19+
};
20+
3221
const result = await new Promise((resolve, reject) => {
3322
lint(options, (err, res) => {
3423
if (err) reject(err);

0 commit comments

Comments
 (0)