Skip to content

Commit

Permalink
test: skip the test with proper TAP message
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
thefourtheye committed Feb 27, 2017
1 parent 893632e commit c6664f6
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions test/parallel/test-setproctitle.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,7 @@ const common = require('../common');

// FIXME add sunos support
if (common.isSunOS) {
console.log(`1..0 # Skipped: Unsupported platform [${process.platform}]`);
return;
return common.skip(`Unsupported platform [${process.platform}]`);
}

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

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

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

0 comments on commit c6664f6

Please sign in to comment.