Skip to content

Commit 75572fb

Browse files
committed
Add a expect utility seed.
It's useful when making meta-nodes, to check that variables that expected were set. Part of #20. Part of #52.
1 parent 42718ad commit 75572fb

File tree

1 file changed

+45
-0
lines changed

1 file changed

+45
-0
lines changed

seeds/example-utility.json

+45
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
{
2+
"version": 0,
3+
"seeds": {
4+
"expect": {
5+
"type": "map",
6+
"items": {
7+
"type": "var",
8+
"name": "arg:args"
9+
},
10+
"block": {
11+
"type": "var",
12+
"name": {
13+
"type": "var",
14+
"name": "value"
15+
},
16+
"else": {
17+
"type": "throw",
18+
"error": {
19+
"type": "render",
20+
"template": "Argument {{key}} is expected but was not set",
21+
"vars": {
22+
"key": {
23+
"type": "var",
24+
"name": "value"
25+
}
26+
}
27+
}
28+
}
29+
}
30+
},
31+
"expect-test": {
32+
"type": "let",
33+
"private": true,
34+
"comment": "This should throw because `not_set` is not set",
35+
"name": "arg:args",
36+
"value": [
37+
"openai_api_key",
38+
"not_set"
39+
],
40+
"block": {
41+
"seed": "expect"
42+
}
43+
}
44+
}
45+
}

0 commit comments

Comments
 (0)