Add test to ensure params.tokens and params.parsers.markdownit are the same object.

This commit is contained in:
David Anson 2023-01-21 19:01:42 -08:00
parent c53df8b720
commit 80235711f4

View file

@ -1200,6 +1200,25 @@ test("customRulesAsyncThrowsInSyncContext", (t) => {
);
});
test("customRulesParamsTokensSameObject", (t) => {
t.plan(1);
const options = {
"customRules": [
{
"names": [ "name" ],
"description": "description",
"tags": [ "tag" ],
"function":
(params) => {
t.is(params.tokens, params.parsers.markdownit);
}
}
],
"files": [ "README.md" ]
};
return markdownlint.promises.markdownlint(options).then(() => null);
});
test("customRulesParamsAreFrozen", (t) => {
const options = {
"customRules": [