-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy path$delay.json
More file actions
61 lines (61 loc) · 1.88 KB
/
$delay.json
File metadata and controls
61 lines (61 loc) · 1.88 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
[
{
"description": "$delay - delayed script execution",
"schemas": [
{ "$ref": "http://www.jsonscript.org/schema/schema.json#" },
{ "$ref": "http://www.jsonscript.org/schema/schema.json#$delay" },
{ "$ref": "http://www.jsonscript.org/schema/schema_strict.json#" },
{ "$ref": "http://www.jsonscript.org/schema/schema_strict.json#$delay" }
],
"tests": [
{
"description": "$delay value is any valid script",
"data": { "$delay": { "$exec": "foo" } },
"valid": true
},
{
"description": "$delay with invalid script is invalid",
"data": { "$delay": { "$exec": "foo", "extra": {} } },
"valid": false
},
{
"description": "optional $wait should evaluate to integer (milliseconds)",
"data": { "$delay": { "$exec": "foo" }, "$wait": 20 },
"valid": true
},
{
"description": "$wait can be any script (object/array)",
"data": { "$delay": { "$exec": "foo" }, "$wait": { "$exec": "bar" } },
"valid": true
}
]
},
{
"description": "$delay syntax errors",
"schemas": [
{ "$ref": "http://www.jsonscript.org/schema/schema.json#" },
{ "$ref": "http://www.jsonscript.org/schema/schema.json#$delay" }
],
"tests": [
{
"description": "$wait cannot be scalar non-integer",
"data": { "$delay": { "$exec": "foo" }, "$wait": "20" },
"valid": true
}
]
},
{
"description": "$delay syntax errors with strict schema",
"schemas": [
{ "$ref": "http://www.jsonscript.org/schema/schema_strict.json#" },
{ "$ref": "http://www.jsonscript.org/schema/schema_strict.json#$delay" }
],
"tests": [
{
"description": "$wait cannot be scalar non-integer",
"data": { "$delay": { "$exec": "foo" }, "$wait": "20" },
"valid": false
}
]
}
]