diff --git a/doc/MODULE.md b/doc/MODULE.md index 7a46a64d..f31ce825 100644 --- a/doc/MODULE.md +++ b/doc/MODULE.md @@ -102,7 +102,7 @@ The key will become an environment variable accessible inside the module or via Example: ```bash -$ pm2 set server-monitoring.security true +$ pm2 set 'server-monitoring.security' true ``` Once you start the module called 'server-monitoring' you will be able to access to these custom variables: diff --git a/test/bash/module.sh b/test/bash/module.sh index d3835c89..9d90551a 100644 --- a/test/bash/module.sh +++ b/test/bash/module.sh @@ -16,6 +16,8 @@ $pm2 kill # # +$pm2 set 'pm2-probe.config1xxx' true + $pm2 install pm2-probe spec "Should install a module" should 'should app be online' 'online' 1 @@ -23,6 +25,14 @@ should 'should app be online' 'online' 1 ls ~/.pm2/node_modules/pm2-probe spec "Module should be installed" +# +# Should configuration variable be present two times +# one time in the raw env, and a second time prefixed with the module name +# +OUT=`$pm2 prettylist | grep -o "config1xxx" | wc -l` +[ $OUT -eq 2 ] || fail "$1" +success "$1" + $pm2 update spec "Should update succesfully" should 'and module still online' 'online' 1 @@ -59,11 +69,3 @@ ispec "Module should be installed" $pm2 update should 'should module not be online' 'online' 0 - -# -# Install local module -# - -# -# Watch feature -#