mirror of
https://github.com/DavidAnson/markdownlint.git
synced 2025-12-23 17:30:12 +01:00
Switch from deprecated nodeunit test runner to tape.
This commit is contained in:
parent
61e0ac314c
commit
3c100a21ff
3 changed files with 1030 additions and 1078 deletions
|
|
@ -5,6 +5,7 @@
|
|||
const fs = require("fs");
|
||||
const path = require("path");
|
||||
const glob = require("glob");
|
||||
const tape = require("tape");
|
||||
const markdownlint = require("../lib/markdownlint");
|
||||
const { utf8Encoding } = require("../helpers");
|
||||
|
||||
|
|
@ -17,18 +18,21 @@ files.filter((file) => /\.md$/.test(file)).forEach((file) => {
|
|||
strings[content.length.toString()] = content;
|
||||
content = content.slice(0, -1);
|
||||
}
|
||||
module.exports[`type ${file}`] = (test) => {
|
||||
tape(`type ${file}`, (test) => {
|
||||
test.plan(1);
|
||||
markdownlint.sync({
|
||||
// @ts-ignore
|
||||
strings,
|
||||
"resultVersion": 0
|
||||
});
|
||||
test.done();
|
||||
};
|
||||
test.pass();
|
||||
test.end();
|
||||
});
|
||||
});
|
||||
|
||||
// Parses all Markdown files in all package dependencies
|
||||
module.exports.parseAllFiles = (test) => {
|
||||
tape("parseAllFiles", (test) => {
|
||||
test.plan(2);
|
||||
const globOptions = {
|
||||
// "cwd": "/",
|
||||
"realpath": true
|
||||
|
|
@ -40,7 +44,7 @@ module.exports.parseAllFiles = (test) => {
|
|||
};
|
||||
markdownlint(markdownlintOptions, (errr) => {
|
||||
test.ifError(errr);
|
||||
test.done();
|
||||
test.end();
|
||||
});
|
||||
});
|
||||
};
|
||||
});
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue