We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
test-setproctitle
ps
1 parent 1784c35 commit fe86bc6Copy full SHA for fe86bc6
1 file changed
test/parallel/test-setproctitle.js
@@ -4,7 +4,7 @@ const common = require('../common');
4
const { isMainThread } = require('worker_threads');
5
6
// FIXME add sunos support
7
-if (common.isSunOS || common.isIBMi) {
+if (common.isSunOS || common.isIBMi || common.isWindows) {
8
common.skip(`Unsupported platform [${process.platform}]`);
9
}
10
@@ -25,15 +25,10 @@ assert.notStrictEqual(process.title, title);
25
process.title = title;
26
assert.strictEqual(process.title, title);
27
28
-// Test setting the title but do not try to run `ps` on Windows.
29
-if (common.isWindows) {
30
- common.skip('Windows does not have "ps" utility');
31
-}
32
-
33
try {
34
execSync('command -v ps');
35
} catch (err) {
36
- if (err.status === 1) {
+ if (err.status === 1 || err.status === 127) {
37
common.skip('The "ps" utility is not available');
38
39
throw err;
@@ -53,5 +48,5 @@ exec(cmd, common.mustSucceed((stdout, stderr) => {
53
48
title += ` (${path.basename(process.execPath)})`;
54
49
55
50
// Omitting trailing whitespace and \n
56
- assert.strictEqual(stdout.replace(/\s+$/, '').endsWith(title), true);
51
+ assert.ok(stdout.trimEnd().endsWith(title));
57
52
}));
0 commit comments