Skip to content

Commit 79f90f3

Browse files
sastanTrott
authored andcommitted
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: #16815 Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com> Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
1 parent 137c780 commit 79f90f3

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

test/parallel/test-repl-history-perm.js

+6-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
11
'use strict';
2+
3+
// Verifies that the REPL history file is created with mode 0600
4+
25
// Flags: --expose_internals
36

47
const common = require('../common');
@@ -39,9 +42,10 @@ const checkResults = common.mustCall(function(err, r) {
3942

4043
r.input.end();
4144
const stat = fs.statSync(replHistoryPath);
45+
const fileMode = stat.mode & 0o777;
4246
assert.strictEqual(
43-
stat.mode & 0o777, 0o600,
44-
'REPL history file should be mode 0600');
47+
fileMode, 0o600,
48+
`REPL history file should be mode 0600 but was 0${fileMode.toString(8)}`);
4549
});
4650

4751
repl.createInternalRepl(

0 commit comments

Comments
 (0)