From 46e37adf59f58523aff0ecf5dc8531ee8bc6b3b4 Mon Sep 17 00:00:00 2001 From: Joyee Cheung Date: Thu, 29 Nov 2018 20:25:03 +0800 Subject: [PATCH] test: show stdout and stderr in test-cli-syntax when it fails To help debugging the flake with the log from the CI. PR-URL: https://github.com/nodejs/node/pull/24720 Refs: https://github.com/nodejs/node/issues/24403 Reviewed-By: Richard Lau Reviewed-By: Daniel Bevenius Reviewed-By: Anna Henningsen Reviewed-By: Luigi Pinca --- test/parallel/test-cli-syntax.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/test/parallel/test-cli-syntax.js b/test/parallel/test-cli-syntax.js index d80e8c698d72de..35cc78258dad01 100644 --- a/test/parallel/test-cli-syntax.js +++ b/test/parallel/test-cli-syntax.js @@ -34,6 +34,12 @@ const notFoundRE = /^Error: Cannot find module/m; const cmd = [node, ..._args].join(' '); exec(cmd, common.mustCall((err, stdout, stderr) => { + if (err) { + console.log('-- stdout --'); + console.log(stdout); + console.log('-- stderr --'); + console.log(stderr); + } assert.ifError(err); assert.strictEqual(stdout, ''); assert.strictEqual(stderr, '');