From 43f28b90c1cb5416a2cec3b286377b3f2d257930 Mon Sep 17 00:00:00 2001 From: David Anson Date: Thu, 7 May 2015 17:42:13 -0700 Subject: [PATCH] Add test to simulate typing each test file to validate handling of partial input. --- test/markdownlint-test.js | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/test/markdownlint-test.js b/test/markdownlint-test.js index 8b02493c..897cbc12 100644 --- a/test/markdownlint-test.js +++ b/test/markdownlint-test.js @@ -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(); +};