Closed nelsonic closed 9 years ago
@nelsonic a PR would be welcome, but I'm not actively maintaining it. Would you like to be the new head maintainer? :smile:
@indexzero I've added some basic tests on a branch: https://github.com/nelsonic/ps-tree/issues/1
But unable to get past 92% coverage because of the if(!module.parent)
which allows the script to be called directly:
if(!module.parent) {
childrenOfPid(process.argv[2] || 1, function (err, data) {
console.log(data)
})
I tried to execute the file from inside my test:
var child = cp.exec("node ./index.js", function(error, data) {
console.log('data: ' + data.length);
if (error !== null) {
console.log(red('exec error: ' + error));
}
})
But that still does not improve coverage...
If you can live without 100% test coverage I can submit the PR.
I would be happy to remove the !module.parent
part all together and make that a separate bin/ps-tree
script.
Ok. I can do that. Next steps:
@indexzero I have substituted:
if(!module.parent) {
childrenOfPid(process.argv[2] || 1, function (err, data) {
console.log(data)
})
}
for ./bin/ps-tree.js containing:
#!/usr/bin/env node
'use strict';
require('../')(process.argv[2] || 1, function (err, data) {
console.log(data)
});
As a result we get 100% test coverage. :+1:
Build passes: https://travis-ci.org/nelsonic/ps-tree/builds/56141651 Submitting PR.
@indexzero should I do a major _version bump_ in package.json or leave that to you?
Hi @indexzero is this module still maintained? Do you have plans to update it? e.g. dependencies:
Would you accept a PR with tests?