Skip to content

Commit cfd1b19

Browse files
vinimdocarmoevanlucas
authored andcommitted
test: expand test coverage of fs.js
* test reading a file passing a not valid enconding Refs: https://coverage.nodejs.org/coverage-067be658f966dafe/root/internal/fs.js.html PR-URL: #10947 Reviewed-By: James M Snell <[email protected]> Reviewed-By: Michael Dawson <[email protected]> Reviewed-By: Gibson Fahnestock <[email protected]>
1 parent 4aedde8 commit cfd1b19

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
'use strict';
2+
require('../common');
3+
4+
const assert = require('assert');
5+
const fs = require('fs');
6+
7+
const encoding = 'foo-8';
8+
const filename = 'bar.txt';
9+
10+
assert.throws(
11+
fs.readFile.bind(fs, filename, { encoding }, () => {}),
12+
new RegExp(`Error: Unknown encoding: ${encoding}$`)
13+
);

0 commit comments

Comments
 (0)