Skip to content

Commit

Permalink
test: expand test coverage of fs.js
Browse files Browse the repository at this point in the history
* 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 <jasnell@gmail.com>
Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com>
Reviewed-By: Gibson Fahnestock <gibfahn@gmail.com>
  • Loading branch information
vinimdocarmo authored and gibfahn committed Jan 27, 2017
1 parent bee83e0 commit b19334e
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions test/parallel/test-fs-read-file-assert-encoding.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
'use strict';
require('../common');

const assert = require('assert');
const fs = require('fs');

const encoding = 'foo-8';
const filename = 'bar.txt';

assert.throws(
fs.readFile.bind(fs, filename, { encoding }, () => {}),
new RegExp(`Error: Unknown encoding: ${encoding}$`)
);

0 comments on commit b19334e

Please sign in to comment.