Skip to content

Commit 99f3b60

Browse files
committed
add basic propertyDependencies tests
1 parent 4cfead7 commit 99f3b60

File tree

1 file changed

+62
-0
lines changed

1 file changed

+62
-0
lines changed
Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
[
2+
{
3+
"description": "propertyDependencies doesn't act on non-objects",
4+
"schema": {
5+
"propertyDependencies": {
6+
"foo": {"bar": false}
7+
}
8+
},
9+
"tests": [
10+
{
11+
"description": "ignores booleans",
12+
"data": true,
13+
"valid": true
14+
},
15+
{
16+
"description": "ignores integers",
17+
"data": 123,
18+
"valid": true
19+
},
20+
{
21+
"description": "ignores floats",
22+
"data": 1.0,
23+
"valid": true
24+
},
25+
{
26+
"description": "ignores string",
27+
"data": "abc",
28+
"valid": true
29+
},
30+
{
31+
"description": "ignores arrays",
32+
"data": [],
33+
"valid": true
34+
},
35+
{
36+
"description": "ignores null",
37+
"data": null,
38+
"valid": true
39+
}
40+
]
41+
},
42+
{
43+
"description": "disallowing values",
44+
"schema": {
45+
"propertyDependencies": {
46+
"foo": {"bar": false}
47+
}
48+
},
49+
"tests": [
50+
{
51+
"description": "bar is invalid",
52+
"data": {"foo": "bar"},
53+
"valid": false
54+
},
55+
{
56+
"description": "anything else is valid",
57+
"data": {"foo": "baz"},
58+
"valid": true
59+
}
60+
]
61+
}
62+
]

0 commit comments

Comments
 (0)