1 | {
|
2 | "test:04-template-merge": {
|
3 | "expect": "ok",
|
4 | "tasks": [{
|
5 | "$template": "jsonParseAndMerge",
|
6 | "$args": ["{\"a\":\"b\"}"]
|
7 | }, {
|
8 | "$template": "jsonParseAndMerge",
|
9 | "$args": ["{\"c\":\"d\"}"],
|
10 | "require": "{$result}"
|
11 | }, {
|
12 | "$function": "dfThrowUnlessDefined",
|
13 | "$args": ["{$result.a}"]
|
14 | }, {
|
15 | "$function": "dfThrowUnlessDefined",
|
16 | "$args": ["{$result.c}"]
|
17 | }]
|
18 | },
|
19 | "test:05-template-set": {
|
20 | "expect": "ok",
|
21 | "tasks": [{
|
22 | "$template": "jsonParseAndSet",
|
23 | "$args": ["{\"a\":\"b\"}"]
|
24 | }, {
|
25 | "$template": "jsonParseAndSet",
|
26 | "$args": ["{\"c\":\"d\"}"],
|
27 | "require": "{$result}"
|
28 | }, {
|
29 | "$function": "dfThrowNow",
|
30 | "$args": ["{$result.a}"]
|
31 | }, {
|
32 | "$function": "dfThrowUnlessDefined",
|
33 | "$args": ["{$result.c}"]
|
34 | }]
|
35 | },
|
36 | "test:06-template-set-important": {
|
37 | "expect": "fail",
|
38 | "tasks": [{
|
39 | "$template": "jsonParseAndSet",
|
40 | "$args": ["{\"a\":\"b\"}"]
|
41 | }, {
|
42 | "$template": "jsonParseAndSet",
|
43 | "$args": ["{\"c\":\"d\"}"],
|
44 | "require": "{$result}"
|
45 | }, {
|
46 | "$function": "dfThrowNow",
|
47 | "// 1 ": "this task must fail because unsatisfied dependencies of result.a",
|
48 | "// 2 ": "which replaced by second JSON parse task. task state is skipped, but $important fail skipped task",
|
49 | "$args": ["{$result.a}"],
|
50 | "$important": true
|
51 | }, {
|
52 | "$function": "dfThrowUnlessDefined",
|
53 | "$args": ["{$result.c}"]
|
54 | }]
|
55 | },
|
56 | "test:07-every-template": {
|
57 | "expect": "ok",
|
58 | "tasks": [{
|
59 | "$every": [0, 1, 2],
|
60 | "$tasks": [{
|
61 | "$template": "indexEqItem"
|
62 | }]
|
63 | }]
|
64 | },
|
65 | "test:08-every-template": {
|
66 | "expect": "fail",
|
67 | "description": "if template doesn't exist, we should expect fail",
|
68 | "tasks": [{
|
69 | "$every": [0, 1, 2],
|
70 | "$tasks": [{
|
71 | "$template": "indexEqItemXXX"
|
72 | }]
|
73 | }]
|
74 | }
|
75 | }
|