Add to test-repos script: mochajs/mocha, webhintio/hint, webpack.js.org, v8-v8-dev.

This commit is contained in:
David Anson 2021-06-13 16:37:29 -07:00
parent 7b810c48a9
commit 427057dd1e
3 changed files with 53 additions and 4 deletions

View file

@ -54,6 +54,7 @@ function lintTestRepo(t, globPatterns, configPath) {
files,
config
};
console.log(`${t.title}: Linting ${files.length} files...`);
return markdownlintPromise(options).then((results) => {
const resultsString = results.toString();
if (resultsString.length > 0) {
@ -79,13 +80,27 @@ test("https://github.com/mkdocs/mkdocs", (t) => {
const globPatterns = [
join(rootDir, "README.md"),
join(rootDir, "CONTRIBUTING.md"),
join(rootDir, "docs/*"),
join(rootDir, "docs/**/*.md"),
"!" + join(rootDir, "docs/CNAME")
];
const configPath = join(rootDir, ".markdownlintrc");
return lintTestRepo(t, globPatterns, configPath);
});
test("https://github.com/mochajs/mocha", (t) => {
const rootDir = "./test-repos/mochajs-mocha";
const globPatterns = [
join(rootDir, "*.md"),
join(rootDir, "docs/**/*.md"),
join(rootDir, ".github/*.md"),
join(rootDir, "lib/**/*.md"),
join(rootDir, "test/**/*.md"),
join(rootDir, "example/**/*.md")
];
const configPath = join(rootDir, ".markdownlint.json");
return lintTestRepo(t, globPatterns, configPath);
});
test("https://github.com/pi-hole/docs", (t) => {
const rootDir = "./test-repos/pi-hole-docs";
const globPatterns = [ join(rootDir, "**/*.md") ];
@ -93,6 +108,23 @@ test("https://github.com/pi-hole/docs", (t) => {
return lintTestRepo(t, globPatterns, configPath);
});
test("https://github.com/webhintio/hint", (t) => {
const rootDir = "./test-repos/webhintio-hint";
const globPatterns = [
join(rootDir, "**/*.md"),
"!" + join(rootDir, "**/CHANGELOG.md")
];
const configPath = join(rootDir, ".markdownlintrc");
return lintTestRepo(t, globPatterns, configPath);
});
test("https://github.com/webpack/webpack.js.org", (t) => {
const rootDir = "./test-repos/webpack-webpack-js-org";
const globPatterns = [ join(rootDir, "**/*.md") ];
const configPath = join(rootDir, ".markdownlint.json");
return lintTestRepo(t, globPatterns, configPath);
});
// Optional repositories (very large)
const dotnetDocsDir = "./test-repos/dotnet-docs";
@ -112,3 +144,13 @@ if (existsSync(dotnetDocsDir)) {
return lintTestRepo(t, globPatterns, configPath);
});
}
const v8v8DevDir = "./test-repos/v8-v8-dev";
if (existsSync(v8v8DevDir)) {
test("https://github.com/v8/v8.dev", (t) => {
const rootDir = v8v8DevDir;
const globPatterns = [ join(rootDir, "src/**/*.md") ];
const configPath = join(rootDir, ".markdownlint.json");
return lintTestRepo(t, globPatterns, configPath);
});
}