mirror of
https://github.com/nodejs/node.git
synced 2026-11-09 15:11:11 -05:00
Add punctuation and comments about code that should not throw. Also remove a obsolete test and refactor some tests. 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>
15 lines
335 B
JavaScript
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 }
|
|
);
|