-
-
Notifications
You must be signed in to change notification settings - Fork 876
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'stoplightio-fix/track-pattern-properties-evaluation'
- Loading branch information
Showing
2 changed files
with
50 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
20 changes: 20 additions & 0 deletions
20
spec/issues/1625_evaluated_truthy_pattern_properties.spec.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
import _Ajv from "../ajv2020" | ||
import * as assert from "assert" | ||
|
||
describe("tracking evaluated properties with pattern properties of schema = true", () => { | ||
it("should initialize evaluated properties", () => { | ||
const ajv = new _Ajv() | ||
|
||
const schema = { | ||
type: "object", | ||
patternProperties: { | ||
"^x-": true, | ||
}, | ||
unevaluatedProperties: false, | ||
} | ||
|
||
const validate = ajv.compile(schema) | ||
assert.strictEqual(validate({bar: 1}), false) | ||
assert.strictEqual(validate({"x-bar": false}), true) | ||
}) | ||
}) |