Refactor to move reparse of micromark htmlFlow token content into core micromarkParse implementation for simplicity and sharing.

This commit is contained in:
David Anson 2023-07-21 22:49:08 -07:00
parent 9646590496
commit e86fb7699d
11 changed files with 307 additions and 84 deletions

View file

@ -9,6 +9,8 @@ const { markdownlint } = require("../lib/markdownlint").promises;
const helpers = require("../helpers");
const constants = require("../lib/constants");
const numericalSortCompareFn = (a, b) => a - b;
/**
* Create a test function for the specified test file.
*
@ -53,7 +55,7 @@ function createTestForFile(file) {
}
}
for (const list of Object.values(expected)) {
list.sort();
list.sort(numericalSortCompareFn);
}
const actual = {};
for (const error of errors) {
@ -69,7 +71,7 @@ function createTestForFile(file) {
);
}
for (const list of Object.values(actual)) {
list.sort();
list.sort(numericalSortCompareFn);
}
t.deepEqual(actual, expected, "Too few or too many issues found.");
// Create snapshot