From c6664f6757335ee4b7e4c2de52ba7e58f9ef4aad Mon Sep 17 00:00:00 2001 From: "Sakthipriyan Vairamani (thefourtheye)" Date: Tue, 28 Feb 2017 00:15:58 +0530 Subject: [PATCH] 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. --- test/parallel/test-setproctitle.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/test/parallel/test-setproctitle.js b/test/parallel/test-setproctitle.js index a971d604b37d14..072ddd447e5bf9 100644 --- a/test/parallel/test-setproctitle.js +++ b/test/parallel/test-setproctitle.js @@ -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'); @@ -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);