Skip to content

Commit 9defa77

Browse files
karenetheridgeJulian
authored andcommitted
squash: add prefixItems: another new 2020-0X keyword
1 parent ebb359d commit 9defa77

File tree

1 file changed

+45
-0
lines changed

1 file changed

+45
-0
lines changed

tests/draft2019-09/future-keywords.json

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,5 +29,50 @@
2929
"valid": true
3030
}
3131
]
32+
},
33+
{
34+
"description": "prefixItems: an array of schemas for items",
35+
"schema": {
36+
"items": [
37+
{"type": "integer"},
38+
{"type": "string"}
39+
]
40+
},
41+
"tests": [
42+
{
43+
"description": "correct types",
44+
"data": [ 1, "foo" ],
45+
"valid": true
46+
},
47+
{
48+
"description": "wrong types",
49+
"data": [ "foo", 1 ],
50+
"valid": true
51+
},
52+
{
53+
"description": "incomplete array of items",
54+
"data": [ 1 ],
55+
"valid": true
56+
},
57+
{
58+
"description": "array with additional items",
59+
"data": [ 1, "foo", true ],
60+
"valid": true
61+
},
62+
{
63+
"description": "empty array",
64+
"data": [ ],
65+
"valid": true
66+
},
67+
{
68+
"description": "JavaScript pseudo-array is valid",
69+
"data": {
70+
"0": "invalid",
71+
"1": "valid",
72+
"length": 2
73+
},
74+
"valid": true
75+
}
76+
]
3277
}
3378
]

0 commit comments

Comments
 (0)