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.
  • Loading branch information
sastan committed Nov 6, 2017
1 parent 8eef52e commit 5f5d6f6
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 5f5d6f6

Please sign in to comment.