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
  • Loading branch information
vinimdocarmo committed Jan 23, 2017
1 parent 49b0d9f commit f328546
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 f328546

Please sign in to comment.