mirror of
https://github.com/nodejs/node.git
synced 2024-12-01 16:10:02 +01:00
095357e26e
In addition refactor common.throws to common.expectsError PR-URL: https://github.com/nodejs/node/pull/13829 Refs: https://github.com/nodejs/node/issues/11273 Reviewed-By: Refael Ackermann <refack@gmail.com> Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com> Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
12 lines
289 B
JavaScript
12 lines
289 B
JavaScript
'use strict';
|
|
|
|
const common = require('../common');
|
|
const fs = require('fs');
|
|
|
|
const encoding = 'foo-8';
|
|
const filename = 'bar.txt';
|
|
common.expectsError(
|
|
fs.readFile.bind(fs, filename, { encoding }, common.mustNotCall()),
|
|
{ code: 'ERR_INVALID_OPT_VALUE_ENCODING', type: TypeError }
|
|
);
|