From 79f90f3d98d1f81ef0065a829b6c14e418401306 Mon Sep 17 00:00:00 2001 From: Sascha Tandel Date: Mon, 6 Nov 2017 15:19:09 +0000 Subject: [PATCH] test: include file mode in assert message If the REPL history file is created with an invalid mode include the failed mode in the error message. PR-URL: https://github.com/nodejs/node/pull/16815 Reviewed-By: Gireesh Punathil Reviewed-By: Joyee Cheung --- test/parallel/test-repl-history-perm.js | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/test/parallel/test-repl-history-perm.js b/test/parallel/test-repl-history-perm.js index 5ca8bf57a43..9f14ece568d 100644 --- a/test/parallel/test-repl-history-perm.js +++ b/test/parallel/test-repl-history-perm.js @@ -1,4 +1,7 @@ 'use strict'; + +// Verifies that the REPL history file is created with mode 0600 + // Flags: --expose_internals const common = require('../common'); @@ -39,9 +42,10 @@ const checkResults = common.mustCall(function(err, r) { r.input.end(); const stat = fs.statSync(replHistoryPath); + const fileMode = stat.mode & 0o777; assert.strictEqual( - stat.mode & 0o777, 0o600, - 'REPL history file should be mode 0600'); + fileMode, 0o600, + `REPL history file should be mode 0600 but was 0${fileMode.toString(8)}`); }); repl.createInternalRepl(