From 12f6a9335280835c510a671c0f52e87c15559f8b Mon Sep 17 00:00:00 2001 From: Soam Vasani Date: Wed, 24 Aug 2016 13:49:45 -0700 Subject: [PATCH] Test other http verbs: get, put, post, delete, options, trace, head. --- src/function-run/nodejs/test/test.js | 5 +++-- src/function-run/nodejs/test/test.sh | 14 +++++++++++--- 2 files changed, 14 insertions(+), 5 deletions(-) diff --git a/src/function-run/nodejs/test/test.js b/src/function-run/nodejs/test/test.js index fc8fca57..288ef627 100644 --- a/src/function-run/nodejs/test/test.js +++ b/src/function-run/nodejs/test/test.js @@ -1,4 +1,5 @@ module.exports = function (context, callback) { - console.log("Test function"); - callback(200, "Hello, world!"); + console.log("Test function entered"); + callback(200, "Hello, world!\n"); + console.log("Test function exit"); } diff --git a/src/function-run/nodejs/test/test.sh b/src/function-run/nodejs/test/test.sh index e8ab274b..49907e64 100755 --- a/src/function-run/nodejs/test/test.sh +++ b/src/function-run/nodejs/test/test.sh @@ -3,7 +3,7 @@ # TODO placeholder until we have better tests :) set +x -set -e +set -e DIR=$(dirname $0) @@ -17,7 +17,15 @@ trap cleanup EXIT sleep 2 echo "-- Specializing" -curl -f -X POST http://localhost:8888/specialize +curl -f -X POST http://localhost:8888/specialize echo "-- Running user function" -curl -f http://localhost:8888 ; echo +curl -f -X GET http://localhost:8888 +curl -f -X POST http://localhost:8888 +curl -f -X PUT http://localhost:8888 +curl -f -X DELETE http://localhost:8888 +curl -f -X TRACE http://localhost:8888 +curl -f -X OPTIONS http://localhost:8888 + +# -I causes curl to make a HEAD request. +curl -f -I http://localhost:8888