Files
node/test/parallel/test-internal-fs.js
Ruben Bridgewater 1eac1d7d85 test: minor refactoring
Add punctuation and comments about code that should not throw.
Also remove a obsolete test and refactor some tests.

Backport-PR-URL: https://github.com/nodejs/node/pull/19244
PR-URL: https://github.com/nodejs/node/pull/18669
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
2018-03-21 10:50:04 +00:00

15 lines
335 B
JavaScript

// Flags: --expose-internals
'use strict';
const common = require('../common');
const fs = require('internal/fs');
// Valid encodings and no args should not throw.
fs.assertEncoding();
fs.assertEncoding('utf8');
common.expectsError(
() => fs.assertEncoding('foo'),
{ code: 'ERR_INVALID_OPT_VALUE_ENCODING', type: TypeError }
);