Debian Codegraph @

spec/issues/1625_evaluated_truthy_pattern_properties.spec.ts

raw ◀ ▶
Source reconstructed at patch state 0 of 1 — not the installed (fully patched) source.
1 Debian patch touch this file
1 import _Ajv from "../ajv2020"
2 import * as assert from "assert"
3
4 describe("tracking evaluated properties with pattern properties of schema = true", () => {
5 it("should initialize evaluated properties", () => {
6 const ajv = new _Ajv()
7
8 const schema = {
9 type: "object",
10 patternProperties: {
11 "^x-": true,
12 },
13 unevaluatedProperties: false,
14 }
15
16 const validate = ajv.compile(schema)
17 assert.strictEqual(validate({bar: 1}), false)
18 assert.strictEqual(validate({"x-bar": false}), true)
19 })
20 })