Skip to content
Closed
Show file tree
Hide file tree
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
4 changes: 2 additions & 2 deletions test/parallel/test-fs-read-file-assert-encoding.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,6 @@ const encoding = 'foo-8';
const filename = 'bar.txt';

assert.throws(
fs.readFile.bind(fs, filename, { encoding }, common.noop),
new RegExp(`Error: Unknown encoding: ${encoding}$`)
fs.readFile.bind(fs, filename, { encoding }, common.mustNotCall()),
new RegExp(`^Error: Unknown encoding: ${encoding}$`)
);
6 changes: 3 additions & 3 deletions test/parallel/test-fs-read-type.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@ assert.throws(() => {
expected.length,
0,
'utf-8',
common.noop);
}, /Second argument needs to be a buffer/);
common.mustNotCall());
}, /^TypeError: Second argument needs to be a buffer$/);

assert.throws(() => {
fs.readSync(fd, expected.length, 0, 'utf-8');
}, /Second argument needs to be a buffer/);
}, /^TypeError: Second argument needs to be a buffer$/);