Skip to content

Commit ccfe651

Browse files
committed
Add test case
1 parent 0aff198 commit ccfe651

File tree

1 file changed

+17
-1
lines changed

1 file changed

+17
-1
lines changed

tests/src/test/scala/runtime/actionContainers/ActionProxyContainerTests.scala

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -227,7 +227,7 @@ class ActionProxyContainerTests extends BasicActionRunnerTests with WskActorSyst
227227
initCode should be(200)
228228
val (runCode, out) = c.run(JsNull)
229229
runCode should be(502)
230-
out should be(Some(JsObject("error" -> JsString("The action did not return a dictionary."))))
230+
out should be(Some(JsObject("error" -> JsString("The action did not return a dictionary or array."))))
231231
}
232232

233233
checkStreams(out, err, {
@@ -270,4 +270,20 @@ class ActionProxyContainerTests extends BasicActionRunnerTests with WskActorSyst
270270
runRes.get.fields.get("pwd_cmd") shouldBe Some(JsString("/action"))
271271
}
272272
}
273+
274+
it should "support array result" in {
275+
withActionContainer() { c =>
276+
val code = """
277+
|#!/bin/bash
278+
|echo '["a", "b"]'
279+
""".stripMargin.trim
280+
281+
val (initCode, initRes) = c.init(initPayload(code))
282+
initCode should be(200)
283+
284+
val (runCode, runRes) = c.runForJsArray(JsObject())
285+
runCode should be(200)
286+
runRes shouldBe Some(JsArray(JsString("a"), JsString("b")))
287+
}
288+
}
273289
}

0 commit comments

Comments
 (0)