mirror of
https://github.com/DavidAnson/markdownlint.git
synced 2025-12-16 22:10:13 +01:00
Handle mixed case for config keys.
This commit is contained in:
parent
c98660c492
commit
071bba88fc
2 changed files with 77 additions and 9 deletions
|
|
@ -349,6 +349,35 @@ module.exports.enableRules = function enableRules(test) {
|
|||
});
|
||||
};
|
||||
|
||||
module.exports.enableRulesMixedCase = function enableRulesMixedCase(test) {
|
||||
test.expect(2);
|
||||
var options = {
|
||||
"files": [
|
||||
"./test/atx_header_spacing.md",
|
||||
"./test/first_header_bad_atx.md"
|
||||
],
|
||||
"config": {
|
||||
"Md002": true,
|
||||
"DeFaUlT": false,
|
||||
"Md019": true
|
||||
}
|
||||
};
|
||||
markdownlint(options, function callback(err, actualResult) {
|
||||
test.ifError(err);
|
||||
var expectedResult = {
|
||||
"./test/atx_header_spacing.md": {
|
||||
"MD002": [ 3 ],
|
||||
"MD019": [ 3, 5 ]
|
||||
},
|
||||
"./test/first_header_bad_atx.md": {
|
||||
"MD002": [ 1 ]
|
||||
}
|
||||
};
|
||||
test.deepEqual(actualResult, expectedResult, "Undetected issues.");
|
||||
test.done();
|
||||
});
|
||||
};
|
||||
|
||||
module.exports.disableTag = function disableTag(test) {
|
||||
test.expect(2);
|
||||
var options = {
|
||||
|
|
@ -404,6 +433,32 @@ module.exports.enableTag = function enableTag(test) {
|
|||
});
|
||||
};
|
||||
|
||||
module.exports.enableTagMixedCase = function enableTagMixedCase(test) {
|
||||
test.expect(2);
|
||||
var options = {
|
||||
"files": [
|
||||
"./test/atx_header_spacing.md",
|
||||
"./test/first_header_bad_atx.md"
|
||||
],
|
||||
"config": {
|
||||
"DeFaUlT": false,
|
||||
"SpAcEs": true
|
||||
}
|
||||
};
|
||||
markdownlint(options, function callback(err, actualResult) {
|
||||
test.ifError(err);
|
||||
var expectedResult = {
|
||||
"./test/atx_header_spacing.md": {
|
||||
"MD018": [ 1 ],
|
||||
"MD019": [ 3, 5 ]
|
||||
},
|
||||
"./test/first_header_bad_atx.md": {}
|
||||
};
|
||||
test.deepEqual(actualResult, expectedResult, "Undetected issues.");
|
||||
test.done();
|
||||
});
|
||||
};
|
||||
|
||||
module.exports.styleFiles = function styleFiles(test) {
|
||||
test.expect(4);
|
||||
fs.readdir("./style", function readdir(err, files) {
|
||||
|
|
@ -634,6 +689,14 @@ module.exports.missingStringValue = function missingStringValue(test) {
|
|||
});
|
||||
};
|
||||
|
||||
module.exports.ruleNamesUpperCase = function ruleNamesUpperCase(test) {
|
||||
test.expect(37);
|
||||
rules.forEach(function forRule(rule) {
|
||||
test.equal(rule.name, rule.name.toUpperCase(), "Rule name not upper-case.");
|
||||
});
|
||||
test.done();
|
||||
};
|
||||
|
||||
module.exports.readme = function readme(test) {
|
||||
test.expect(97);
|
||||
var tagToRules = {};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue