mirror of
https://github.com/DavidAnson/markdownlint.git
synced 2025-09-22 05:40:48 +02:00
Add test that parses all Markdown files to find crashes.
This commit is contained in:
parent
e60e16baf0
commit
0832793497
2 changed files with 20 additions and 1 deletions
|
@ -26,6 +26,7 @@
|
|||
"browserify": "^13.0.0",
|
||||
"cpy-cli": "^1.0.0",
|
||||
"eslint": "^1.10.3",
|
||||
"glob": "^7.0.0",
|
||||
"istanbul": "^0.4.2",
|
||||
"nodeunit": "^0.9.1",
|
||||
"q": "^1.4.0",
|
||||
|
|
|
@ -4,6 +4,7 @@ var fs = require("fs");
|
|||
var path = require("path");
|
||||
var md = require("markdown-it")();
|
||||
var Q = require("q");
|
||||
var glob = require("glob");
|
||||
var markdownlint = require("../lib/markdownlint");
|
||||
var shared = require("../lib/shared");
|
||||
var rules = require("../lib/rules");
|
||||
|
@ -886,7 +887,7 @@ module.exports.doc = function doc(test) {
|
|||
});
|
||||
};
|
||||
|
||||
module.exports.typeAllFiles = function typeAllFiles(test) {
|
||||
module.exports.typeTestFiles = function typeTestFiles(test) {
|
||||
// Simulates typing each test file to validate handling of partial input
|
||||
function validate(file, content) {
|
||||
var results = markdownlint.sync({
|
||||
|
@ -917,6 +918,23 @@ module.exports.typeAllFiles = function typeAllFiles(test) {
|
|||
test.done();
|
||||
};
|
||||
|
||||
module.exports.parseAllFiles = function parseAllFiles(test) {
|
||||
var globOptions = {
|
||||
// "cwd": "/",
|
||||
"realpath": true
|
||||
};
|
||||
glob("**/*.{md,markdown}", globOptions, function globCallback(err, matches) {
|
||||
test.ifError(err);
|
||||
var markdownlintOptions = {
|
||||
"files": matches
|
||||
};
|
||||
markdownlint(markdownlintOptions, function markdownlintCallback(errr) {
|
||||
test.ifError(errr);
|
||||
test.done();
|
||||
});
|
||||
});
|
||||
};
|
||||
|
||||
module.exports.trimPolyfills = function trimPolyfills(test) {
|
||||
var inputs = [
|
||||
"text text",
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue