From 80235711f42c6eee1cc6c9e6ff3fa2e1cb15617d Mon Sep 17 00:00:00 2001 From: David Anson Date: Sat, 21 Jan 2023 19:01:42 -0800 Subject: [PATCH] Add test to ensure params.tokens and params.parsers.markdownit are the same object. --- test/markdownlint-test-custom-rules.js | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/test/markdownlint-test-custom-rules.js b/test/markdownlint-test-custom-rules.js index 7d6f0534..09f498c6 100644 --- a/test/markdownlint-test-custom-rules.js +++ b/test/markdownlint-test-custom-rules.js @@ -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": [