wip
Some checks failed
Checkers / linkcheck (push) Has been cancelled
Checkers / spellcheck (push) Has been cancelled
CI / build (20, macos-latest) (push) Has been cancelled
CI / build (20, ubuntu-latest) (push) Has been cancelled
CI / build (20, windows-latest) (push) Has been cancelled
CI / build (22, macos-latest) (push) Has been cancelled
CI / build (22, ubuntu-latest) (push) Has been cancelled
CI / build (22, windows-latest) (push) Has been cancelled
CI / build (24, macos-latest) (push) Has been cancelled
CI / build (24, ubuntu-latest) (push) Has been cancelled
CI / build (24, windows-latest) (push) Has been cancelled
CI / pnpm (push) Has been cancelled
CodeQL / Analyze (push) Has been cancelled
TestRepos / build (latest, ubuntu-latest) (push) Has been cancelled
UpdateTestRepos / update (push) Has been cancelled

This commit is contained in:
David Anson 2025-08-27 21:55:30 -07:00
parent 802e3fbdd4
commit e4bcef6685
6 changed files with 24 additions and 14 deletions

View file

@ -24,6 +24,7 @@ test("customRulesV0", (t) => new Promise((resolve) => {
"customRules": customRules.all,
"files": [ customRulesMd ],
markdownItFactory,
// @ts-ignore
"resultVersion": 0
};
lintAsync(options, function callback(err, actualResult) {
@ -97,6 +98,7 @@ test("customRulesV1", (t) => new Promise((resolve) => {
"customRules": customRules.all,
"files": [ customRulesMd ],
markdownItFactory,
// @ts-ignore
"resultVersion": 1
};
lintAsync(options, function callback(err, actualResult) {
@ -229,6 +231,7 @@ test("customRulesV2", (t) => new Promise((resolve) => {
"customRules": customRules.all,
"files": [ customRulesMd ],
markdownItFactory,
// @ts-ignore
"resultVersion": 2
};
lintAsync(options, function callback(err, actualResult) {
@ -358,6 +361,7 @@ test("customRulesConfig", (t) => new Promise((resolve) => {
"letters-e-x": false
},
markdownItFactory,
// @ts-ignore
"resultVersion": 0
};
lintAsync(options, function callback(err, actualResult) {
@ -387,6 +391,7 @@ test("customRulesNpmPackage", (t) => new Promise((resolve) => {
"strings": {
"string": "# Text\n\n---\n\nText ✅\n"
},
// @ts-ignore
"resultVersion": 0
};
lintAsync(options, function callback(err, actualResult) {

View file

@ -627,7 +627,7 @@ test("frontMatterResultVersion3", (t) => new Promise((resolve) => {
}));
test("convertToResultVersionN", async(t) => {
t.plan(6);
t.plan(8);
const options = {
"files": [
"./test/break-all-the-rules.md",
@ -638,19 +638,27 @@ test("convertToResultVersionN", async(t) => {
"banana": "## Heading"
}
};
const [ version3, version2, version1, version0 ] = await Promise.all([
const [ base, version3, version2, version1, version0 ] = await Promise.all([
lintPromise(options),
// @ts-ignore
lintPromise({ ...options, "resultVersion": 3 }),
// @ts-ignore
lintPromise({ ...options, "resultVersion": 2 }),
// @ts-ignore
lintPromise({ ...options, "resultVersion": 1 }),
// @ts-ignore
lintPromise({ ...options, "resultVersion": 0 })
]);
const v2 = convertToResultVersion2(version3);
const v3 = version3;
t.deepEqual(v3, base);
t.is(v3.toString(), base.toString());
const v2 = convertToResultVersion2(base);
t.deepEqual(v2, version2);
t.is(v2.toString(), version2.toString());
const v1 = convertToResultVersion1(version3);
const v1 = convertToResultVersion1(base);
t.deepEqual(v1, version1);
t.is(v1.toString(), version1.toString());
const v0 = convertToResultVersion0(version3);
const v0 = convertToResultVersion0(base);
t.deepEqual(v0, version0);
t.is(v0.toString(), version0.toString());
});

View file

@ -546,6 +546,7 @@ test("nullFrontMatter", (t) => new Promise((resolve) => {
"default": false,
"MD010": true
},
// @ts-ignore
"resultVersion": 0
}, function callback(err, result) {
t.falsy(err);
@ -598,6 +599,7 @@ test("noInlineConfig", (t) => new Promise((resolve) => {
].join("\n")
},
"noInlineConfig": true,
// @ts-ignore
"resultVersion": 0
}, function callback(err, result) {
t.falsy(err);
@ -1229,6 +1231,7 @@ Text with: [^footnote]
[reference]: https://example.com
`
},
// @ts-ignore
"resultVersion": 0
}, (err, actual) => {
t.falsy(err);