mirror of
https://github.com/DavidAnson/markdownlint.git
synced 2025-12-16 14:00:13 +01:00
Delete markdownlint-test-default-config.json, allow MD041 to default to true, add missing headings.
This commit is contained in:
parent
bb157b2ce7
commit
3827842930
81 changed files with 161 additions and 123 deletions
|
|
@ -7,11 +7,9 @@ const path = require("path");
|
|||
const { promisify } = require("util");
|
||||
const tape = require("tape");
|
||||
require("tape-player");
|
||||
const packageJson = require("../package.json");
|
||||
const { version } = require("../package.json");
|
||||
const markdownlint = require("../lib/markdownlint");
|
||||
const helpers = require("../helpers");
|
||||
const defaultConfig = require("./markdownlint-test-default-config.json");
|
||||
const version = packageJson.version;
|
||||
|
||||
/**
|
||||
* Create a test function for the specified test file.
|
||||
|
|
@ -27,7 +25,7 @@ function createTestForFile(file) {
|
|||
const resultsFile = file.replace(/\.md$/, ".results.json");
|
||||
const fixedFile = file.replace(/\.md$/, ".md.fixed");
|
||||
const configFile = file.replace(/\.md$/, ".json");
|
||||
let mergedConfig = null;
|
||||
let config = null;
|
||||
const actualPromise = fs.promises.stat(configFile)
|
||||
.then(
|
||||
function configFileExists() {
|
||||
|
|
@ -38,14 +36,15 @@ function createTestForFile(file) {
|
|||
return {};
|
||||
})
|
||||
.then(
|
||||
function lintWithConfig(config) {
|
||||
mergedConfig = {
|
||||
...defaultConfig,
|
||||
...config
|
||||
};
|
||||
function captureConfig(configResult) {
|
||||
config = configResult;
|
||||
}
|
||||
)
|
||||
.then(
|
||||
function lintWithConfig() {
|
||||
return markdownlintPromise({
|
||||
"files": [ file ],
|
||||
"config": mergedConfig,
|
||||
config,
|
||||
"resultVersion": detailedResults ? 2 : 3
|
||||
});
|
||||
})
|
||||
|
|
@ -55,7 +54,7 @@ function createTestForFile(file) {
|
|||
Promise.all([
|
||||
markdownlintPromise({
|
||||
"files": [ file ],
|
||||
"config": mergedConfig,
|
||||
config,
|
||||
"resultVersion": 3
|
||||
}),
|
||||
fs.promises.readFile(file, "utf8"),
|
||||
|
|
@ -150,7 +149,7 @@ function createTestForFile(file) {
|
|||
"strings": {
|
||||
"input": corrections
|
||||
},
|
||||
"config": mergedConfig,
|
||||
config,
|
||||
"resultVersion": 3
|
||||
});
|
||||
})
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue