Skip to content

Commit

Permalink
fix: tests
Browse files Browse the repository at this point in the history
Signed-off-by: William Poussier <[email protected]>
  • Loading branch information
wI2L committed Jul 11, 2020
1 parent 87774d8 commit 5bc7e9f
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
4 changes: 3 additions & 1 deletion engine/engine_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -716,7 +716,9 @@ func TestJSONParsing(t *testing.T) {

output := res.Steps["stepOne"].Output.(map[string]interface{})
assert.Equal(t, "utask", output["a"])
assert.Equal(t, 666, output["b"])
assert.Equal(t, "666", output["b"])
assert.Equal(t, "map[k:v]", output["c"])
assert.Equal(t, "[1 2 3]", output["d"])
}

func TestRetryLoop(t *testing.T) {
Expand Down
4 changes: 3 additions & 1 deletion engine/templates_tests/jsonParsing.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ auto_runnable: true
variables:
- name: rawJSON
expression: >
var o = {"a":"utask", "b":666};
var o = {"a":"utask","b":666,"c":{"k":"v"},"d":["1","2","3"]};
JSON.stringify(o);
steps:
Expand All @@ -18,3 +18,5 @@ steps:
output:
a: '{{(eval `rawJSON` | fromJson).a}}'
b: '{{(eval `rawJSON` | mustFromJson).b}}'
c: '{{(eval `rawJSON` | mustFromJson).c}}'
d: '{{(eval `rawJSON` | fromJson).d}}'

0 comments on commit 5bc7e9f

Please sign in to comment.