mirror of
https://github.com/nodejs/node.git
synced 2024-12-01 16:10:02 +01:00
975f6c1f70
PR-URL: https://github.com/nodejs/node/pull/20504 Refs: https://github.com/nodejs/TSC/issues/389 Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Myles Borins <myles.borins@gmail.com> Reviewed-By: Shingo Inoue <leko.noor@gmail.com> Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com> Reviewed-By: Tiancheng "Timothy" Gu <timothygu99@gmail.com> Reviewed-By: Ali Ijaz Sheikh <ofrobots@google.com>
15 lines
341 B
JavaScript
15 lines
341 B
JavaScript
// Flags: --expose-internals
|
|
'use strict';
|
|
|
|
const common = require('../common');
|
|
const fs = require('internal/fs/utils');
|
|
|
|
// 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 }
|
|
);
|