mirror of
https://github.com/DavidAnson/markdownlint.git
synced 2025-12-17 06:20:12 +01:00
Enable, validate, and demonstrate the use of built-in style definitions (fixes #593).
This commit is contained in:
parent
eb05bac07d
commit
c383aab383
3 changed files with 21 additions and 4 deletions
|
|
@ -12,7 +12,8 @@ const pluginSup = require("markdown-it-sup");
|
|||
const pluginTexMath = require("markdown-it-texmath");
|
||||
const test = require("ava").default;
|
||||
const tv4 = require("tv4");
|
||||
const { homepage, version } = require("../package.json");
|
||||
const { "exports": packageExports, homepage, version } =
|
||||
require("../package.json");
|
||||
const markdownlint = require("../lib/markdownlint");
|
||||
const constants = require("../lib/constants");
|
||||
const rules = require("../lib/rules");
|
||||
|
|
@ -430,11 +431,14 @@ test("enableTagMixedCase", (t) => new Promise((resolve) => {
|
|||
}));
|
||||
|
||||
test("styleFiles", (t) => new Promise((resolve) => {
|
||||
t.plan(4);
|
||||
t.plan(7);
|
||||
fs.readdir("./style", function readdir(err, files) {
|
||||
t.falsy(err);
|
||||
for (const file of files) {
|
||||
t.truthy(require(path.join("../style", file)), "Unable to load/parse.");
|
||||
const exportValue = `./style/${file}`;
|
||||
const exportKey = exportValue.replace(/\.json$/, "");
|
||||
t.is(packageExports[exportKey], exportValue);
|
||||
}
|
||||
resolve();
|
||||
});
|
||||
|
|
@ -1402,6 +1406,8 @@ test("getVersion", (t) => {
|
|||
|
||||
test("constants", (t) => {
|
||||
t.plan(2);
|
||||
// @ts-ignore
|
||||
t.is(constants.homepage, homepage);
|
||||
// @ts-ignore
|
||||
t.is(constants.version, version);
|
||||
});
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue