Skip to content

Commit 5c6a43d

Browse files
authored
Merge pull request #158 from deBhal/add/test/visit-inside-anyof-and-oneof
Add test for nested selectors
2 parents 3bebc8d + 8ace642 commit 5c6a43d

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

test/schema-path.js

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -145,3 +145,23 @@ tape('schemaPath', function(t) {
145145

146146
t.end()
147147
})
148+
149+
tape('schemaPath - nested selectors', function(t) {
150+
var schema = {
151+
anyOf: [
152+
{ oneOf:[
153+
{ allOf: [
154+
{
155+
properties: {
156+
nestedSelectors: {type: "integer"}
157+
}
158+
}
159+
]}
160+
]}
161+
]
162+
}
163+
var validate = validator(schema, { verbose: true, greedy: true } );
164+
t.notOk(validate({nestedSelectors: "nope"}), 'should not crash on visit inside *Of');
165+
166+
t.end()
167+
})

0 commit comments

Comments
 (0)