mirror of
https://github.com/DavidAnson/markdownlint.git
synced 2026-01-03 22:48:49 +01:00
Split markdownlint-test-extra-* tests into separate files for (slightly) better concurrency.
This commit is contained in:
parent
442dcfe5b8
commit
0d9dfe7120
4 changed files with 1 additions and 77 deletions
|
|
@ -2,32 +2,10 @@
|
|||
|
||||
"use strict";
|
||||
|
||||
const fs = require("fs");
|
||||
const path = require("path");
|
||||
const globby = require("globby");
|
||||
const test = require("ava").default;
|
||||
const markdownlint = require("../lib/markdownlint");
|
||||
|
||||
// Simulates typing each test file to validate handling of partial input
|
||||
const files = fs.readdirSync("./test");
|
||||
files.filter((file) => /\.md$/.test(file)).forEach((file) => {
|
||||
const strings = {};
|
||||
let content = fs.readFileSync(path.join("./test", file), "utf8");
|
||||
while (content) {
|
||||
strings[content.length.toString()] = content;
|
||||
content = content.slice(0, -1);
|
||||
}
|
||||
test(`type ${file}`, (t) => {
|
||||
t.plan(1);
|
||||
markdownlint.sync({
|
||||
// @ts-ignore
|
||||
strings,
|
||||
"resultVersion": 0
|
||||
});
|
||||
t.pass();
|
||||
});
|
||||
});
|
||||
|
||||
// Parses all Markdown files in all package dependencies
|
||||
test.cb("parseAllFiles", (t) => {
|
||||
t.plan(1);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue