diff --git a/examples/child.js b/examples/child.js index 55120bd4..49b001cd 100644 --- a/examples/child.js +++ b/examples/child.js @@ -1,4 +1,5 @@ + var pmx = require('pmx').init({ http : true }); diff --git a/test/bash/app-configuration.sh b/test/bash/app-configuration.sh index c405ef4e..e8dd05f5 100644 --- a/test/bash/app-configuration.sh +++ b/test/bash/app-configuration.sh @@ -1,4 +1,3 @@ - #!/usr/bin/env bash SRC=$(cd $(dirname "$0"); pwd) diff --git a/test/bash/cli-actions-1.sh b/test/bash/cli-actions-1.sh index ee29e438..9f369cd4 100644 --- a/test/bash/cli-actions-1.sh +++ b/test/bash/cli-actions-1.sh @@ -5,6 +5,16 @@ source "${SRC}/include.sh" cd $file_path +# Determine wget / curl +which wget > /dev/null +if [ $? -eq 0 ] +then + http_get="wget" +else + echo -e "\033[31mYou need wget to run this test \033[0m"; + exit 1; +fi + # # Different way to stop process # diff --git a/test/bash/include.sh b/test/bash/include.sh index 11823ac9..bb9c7988 100644 --- a/test/bash/include.sh +++ b/test/bash/include.sh @@ -1,39 +1,20 @@ - -# -# cli-test: Tests for god # # (C) 2013 Unitech.io Inc. -# MIT LICENSE # -# Yes, we have tests in bash. How mad science is that? - # export PM2_RPC_PORT=4242 # export PM2_PUB_PORT=4243 node="`type -P node`" -nodeVersion="`$node -v`" pm2="`type -P node` `pwd`/bin/pm2" -script="echo" - file_path="test/fixtures" #set -o verbose $pm2 kill -# Determine wget / curl -which wget > /dev/null -if [ $? -eq 0 ] -then - http_get="wget" -else - echo -e "\033[31mYou need wget to run this test \033[0m"; - exit 1; -fi - function fail { echo -e "######## \033[31m ✘ $1\033[0m" exit 1 diff --git a/test/bash/pm2-dev.sh b/test/bash/pm2-dev.sh new file mode 100644 index 00000000..80ed4d97 --- /dev/null +++ b/test/bash/pm2-dev.sh @@ -0,0 +1,15 @@ +#!/usr/bin/env bash + +SRC=$(cd $(dirname "$0"); pwd) +source "${SRC}/include.sh" + +pm2dev="`type -P node` `pwd`/bin/pm2-dev" + +$pm2 link delete + +$pm2dev child.js & +PM2_PID=$! + +sleep 2 +kill $PM2_PID +spec "should process been killed" diff --git a/test/pm2_behavior_tests.sh b/test/pm2_behavior_tests.sh index 8f4b925a..fb7cf1bd 100644 --- a/test/pm2_behavior_tests.sh +++ b/test/pm2_behavior_tests.sh @@ -87,4 +87,7 @@ spec "Source map resolution on exception" bash ./test/bash/inside-pm2.sh spec "Starting a process inside a PM2 process" +bash ./test/bash/pm2-dev.sh +spec "pm2-dev" + $pm2 kill