2017-01-23 14:39:40 -03:00
|
|
|
'use strict';
|
|
|
|
|
2017-03-24 09:46:44 -07:00
|
|
|
const common = require('../common');
|
2017-01-23 14:39:40 -03:00
|
|
|
const fs = require('fs');
|
|
|
|
|
|
|
|
const encoding = 'foo-8';
|
|
|
|
const filename = 'bar.txt';
|
2017-06-20 23:20:10 +02:00
|
|
|
common.expectsError(
|
2017-06-06 09:53:32 -07:00
|
|
|
fs.readFile.bind(fs, filename, { encoding }, common.mustNotCall()),
|
2017-06-20 23:20:10 +02:00
|
|
|
{ code: 'ERR_INVALID_OPT_VALUE_ENCODING', type: TypeError }
|
2017-01-23 14:39:40 -03:00
|
|
|
);
|