mirror of
https://github.com/DavidAnson/markdownlint.git
synced 2025-09-22 05:40:48 +02:00
Add test to simulate typing each test file to validate handling of partial input.
This commit is contained in:
parent
6a8f31ddad
commit
43f28b90c1
1 changed files with 20 additions and 0 deletions
|
@ -647,3 +647,23 @@ module.exports.doc = function doc(test) {
|
|||
test.done();
|
||||
});
|
||||
};
|
||||
|
||||
module.exports.typeAllFiles = function typeAllFiles(test) {
|
||||
// Simulates typing each test file to validate handling of partial input
|
||||
var files = fs.readdirSync("./test");
|
||||
files.forEach(function forFile(file) {
|
||||
if (/\.md$/.test(file)) {
|
||||
var content = fs.readFileSync(
|
||||
path.join("./test", file), shared.utf8Encoding);
|
||||
while (content) {
|
||||
markdownlint.sync({
|
||||
"strings": {
|
||||
"content": content
|
||||
}
|
||||
});
|
||||
content = content.slice(0, -1);
|
||||
}
|
||||
}
|
||||
});
|
||||
test.done();
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue