mirror of
https://github.com/DavidAnson/markdownlint.git
synced 2025-09-22 05:40:48 +02:00
Add more test coverage for additionalProperties in config schema.
This commit is contained in:
parent
77d0105b4a
commit
646a67b8bd
1 changed files with 16 additions and 0 deletions
|
@ -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);
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue