Software: Apache/2.4.41 (Ubuntu). PHP/8.0.30 uname -a: Linux apirnd 5.4.0-204-generic #224-Ubuntu SMP Thu Dec 5 13:38:28 UTC 2024 x86_64 uid=33(www-data) gid=33(www-data) groups=33(www-data) Safe-mode: OFF (not secure) /var/www/html/proxy_server/node_modules/is-running/test/ drwxr-xr-x | |
| Viewing file: Select action/file-type: var inspect = require('eyespect').inspector()
var running = require('../index')
var should = require('should')
var assert = require('assert')
var path = require('path')
var fork = require('child_process').fork
describe('is-running', function () {
it('should return true when process is running', function () {
var childScriptPath = path.join(__dirname, 'dummyChild.js')
var child = fork(childScriptPath)
var pid = child.pid
var found = running(pid)
// cleanup
child.kill()
assert.ok(found, 'pid is not running when it should be')
})
it('should return false when process is not running', function () {
// there could be a better way to get a non-running process besides a really big number
var pid = 20932842309847
var found = running(pid)
assert.ok(!found, 'pid is running when it should not be')
})
})
|
:: Command execute :: | |
--[ c99shell v. 2.5 [PHP 8 Update] [24.05.2025] | Generation time: 0.0219 ]-- |