mirror of
https://github.com/nodejs/node.git
synced 2025-05-02 16:22:29 +00:00

PR-URL: https://github.com/nodejs/node/pull/14162 Reviewed-By: Vse Mozhet Byt <vsemozhetbyt@gmail.com> Reviewed-By: Refael Ackermann <refack@gmail.com> Reviewed-By: Timothy Gu <timothygu99@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
14 lines
373 B
JavaScript
14 lines
373 B
JavaScript
// Flags: --expose-internals
|
|
'use strict';
|
|
|
|
const common = require('../common');
|
|
const assert = require('assert');
|
|
const fs = require('internal/fs');
|
|
|
|
assert.doesNotThrow(() => fs.assertEncoding());
|
|
assert.doesNotThrow(() => fs.assertEncoding('utf8'));
|
|
common.expectsError(
|
|
() => fs.assertEncoding('foo'),
|
|
{ code: 'ERR_INVALID_OPT_VALUE_ENCODING', type: TypeError }
|
|
);
|