A very rudimentary test script
We should have real tests with mocha/chai etc. Until then, use this little bash script.
This commit is contained in:
@@ -0,0 +1,4 @@
|
|||||||
|
exports = function (context, callback) {
|
||||||
|
console.log("Test function");
|
||||||
|
callback(200, "Hello, world!");
|
||||||
|
}
|
||||||
Executable
+22
@@ -0,0 +1,22 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
# TODO placeholder until we have better tests :)
|
||||||
|
|
||||||
|
set +x
|
||||||
|
set -e
|
||||||
|
|
||||||
|
DIR=$(dirname $0)
|
||||||
|
|
||||||
|
echo "-- Starting server"
|
||||||
|
node $DIR/../server.js --codepath $DIR/test.js --port 8888 &
|
||||||
|
sleep 2
|
||||||
|
|
||||||
|
echo "-- Specializing"
|
||||||
|
curl -f -X POST http://localhost:8888/specialize
|
||||||
|
|
||||||
|
echo "-- Running user function"
|
||||||
|
curl -f http://localhost:8888 ; echo
|
||||||
|
|
||||||
|
echo "-- Cleanup"
|
||||||
|
kill %1
|
||||||
|
|
||||||
Reference in New Issue
Block a user