Skip to content

Commit dd558a5

Browse files
sastanMylesBorins
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 3d8b3f7 commit dd558a5

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');
@@ -40,9 +43,10 @@ const checkResults = common.mustCall(function(err, r) {
4043

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

4852
repl.createInternalRepl(

0 commit comments

Comments
 (0)