Skip to content

Commit c6664f6

Browse files
committed
test: skip the test with proper TAP message
On Windows, the test simply returns which will be counted as passed. The test actually skips the rest of the test. So proper TAP message has to be included while skipping. This patch uses `common.skip` rather than `console.log` to print the skip messages.
1 parent 893632e commit c6664f6

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

test/parallel/test-setproctitle.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,7 @@ const common = require('../common');
44

55
// FIXME add sunos support
66
if (common.isSunOS) {
7-
console.log(`1..0 # Skipped: Unsupported platform [${process.platform}]`);
8-
return;
7+
return common.skip(`Unsupported platform [${process.platform}]`);
98
}
109

1110
const assert = require('assert');
@@ -22,8 +21,9 @@ process.title = title;
2221
assert.strictEqual(process.title, title);
2322

2423
// Test setting the title but do not try to run `ps` on Windows.
25-
if (common.isWindows)
26-
return;
24+
if (common.isWindows) {
25+
return common.skip('Windows does not have "ps" utility');
26+
}
2727

2828
exec(`ps -p ${process.pid} -o args=`, function callback(error, stdout, stderr) {
2929
assert.ifError(error);

0 commit comments

Comments
 (0)