mirror of
https://github.com/Unitech/pm2.git
synced 2025-12-08 20:35:53 +00:00
add test to double check configuration presence in module
This commit is contained in:
parent
be06178629
commit
1ab5b28ffb
@ -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:
|
||||
|
||||
@ -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
|
||||
#
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user