Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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.
  • Loading branch information
sastan committed Nov 6, 2017
commit 5f5d6f66bfb0e698593e3bf77500ddfc4a02671b
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