Skip to content

Commit

Permalink
test: include file mode in assert message
Browse files Browse the repository at this point in the history
If the REPL history file is created with an invalid mode include
the failed mode in the error message.

PR-URL: #16815
Reviewed-By: Gireesh Punathil <[email protected]>
Reviewed-By: Joyee Cheung <[email protected]>
  • Loading branch information
sastan authored and Trott committed Nov 7, 2017
1 parent 137c780 commit 79f90f3
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions test/parallel/test-repl-history-perm.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
'use strict';

// Verifies that the REPL history file is created with mode 0600

// Flags: --expose_internals

const common = require('../common');
Expand Down Expand Up @@ -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(
Expand Down

0 comments on commit 79f90f3

Please sign in to comment.