Skip to content

Commit cd3c478

Browse files
thefourtheyejasnell
authored andcommitted
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. PR-URL: #11584 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Gibson Fahnestock <gibfahn@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
1 parent aab0d20 commit cd3c478

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

test/parallel/test-setproctitle.js

+4-4
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)