From 646a67b8bd5d7cf47a66256a23fb496b9f358dad Mon Sep 17 00:00:00 2001 From: David Anson Date: Tue, 15 Jun 2021 22:25:51 -0700 Subject: [PATCH] Add more test coverage for additionalProperties in config schema. --- test/markdownlint-test.js | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/test/markdownlint-test.js b/test/markdownlint-test.js index 32b73edc..174e43f3 100644 --- a/test/markdownlint-test.js +++ b/test/markdownlint-test.js @@ -1010,6 +1010,22 @@ test("validateConfigSchemaAllowsUnknownProperties", (t) => { }); }); +test("validateConfigSchemaAppliesToUnknownProperties", (t) => { + t.plan(4); + for (const allowed of [ true, {} ]) { + t.true( + // @ts-ignore + tv4.validate({ "property": allowed }, configSchema), + `Unknown property value ${allowed} blocked`); + } + for (const blocked of [ 2, "string" ]) { + t.false( + // @ts-ignore + tv4.validate({ "property": blocked }, configSchema), + `Unknown property value ${blocked} allowed`); + } +}); + test("validateConfigExampleJson", (t) => { t.plan(2);