mirror of
https://github.com/DavidAnson/markdownlint.git
synced 2025-12-16 22:10:13 +01:00
Improve README.md/CustomRules.md, add CustomRules.md/Rules.md to tests.
This commit is contained in:
parent
e0e5ce555a
commit
94d5432f4d
4 changed files with 58 additions and 11 deletions
|
|
@ -182,18 +182,19 @@ fs.readdirSync("./test")
|
|||
// @ts-ignore
|
||||
.forEach((file) => tape(file, createTestForFile(path.join("./test", file))));
|
||||
|
||||
tape("projectFiles", (test) => {
|
||||
tape("projectFilesNoInlineConfig", (test) => {
|
||||
test.plan(2);
|
||||
const options = {
|
||||
"files": [
|
||||
"README.md",
|
||||
"CONTRIBUTING.md",
|
||||
"doc/CustomRules.md",
|
||||
"helpers/README.md"
|
||||
],
|
||||
"noInlineConfig": true,
|
||||
"config": {
|
||||
"MD013": { "line_length": 150 },
|
||||
"MD024": false
|
||||
"line-length": { "line_length": 150 },
|
||||
"no-duplicate-heading": false
|
||||
}
|
||||
};
|
||||
markdownlint(options, function callback(err, actual) {
|
||||
|
|
@ -201,6 +202,7 @@ tape("projectFiles", (test) => {
|
|||
const expected = {
|
||||
"README.md": [],
|
||||
"CONTRIBUTING.md": [],
|
||||
"doc/CustomRules.md": [],
|
||||
"helpers/README.md": []
|
||||
};
|
||||
test.deepLooseEqual(actual, expected, "Issue(s) with project files.");
|
||||
|
|
@ -208,6 +210,25 @@ tape("projectFiles", (test) => {
|
|||
});
|
||||
});
|
||||
|
||||
tape("projectFilesInlineConfig", (test) => {
|
||||
test.plan(2);
|
||||
const options = {
|
||||
"files": [ "doc/Rules.md" ],
|
||||
"config": {
|
||||
"line-length": { "line_length": 150 },
|
||||
"no-inline-html": false
|
||||
}
|
||||
};
|
||||
markdownlint(options, function callback(err, actual) {
|
||||
test.ifError(err);
|
||||
const expected = {
|
||||
"doc/Rules.md": []
|
||||
};
|
||||
test.deepLooseEqual(actual, expected, "Issue(s) with project files.");
|
||||
test.end();
|
||||
});
|
||||
});
|
||||
|
||||
tape("resultFormattingV0", (test) => {
|
||||
test.plan(4);
|
||||
const options = {
|
||||
|
|
@ -1509,7 +1530,7 @@ tape("readme", (test) => {
|
|||
});
|
||||
});
|
||||
|
||||
tape("doc", (test) => {
|
||||
tape("rules", (test) => {
|
||||
test.plan(336);
|
||||
fs.readFile("doc/Rules.md", helpers.utf8Encoding,
|
||||
(err, contents) => {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue