mirror of https://github.com/lukechilds/node.git
Browse Source
* Assign codes to errors reported by internal/fs.js PR-URL: https://github.com/nodejs/node/pull/11317 Refs: https://github.com/nodejs/node/issues/11273 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com> Reviewed-By: Franziska Hinkelmann <franziska.hinkelmann@gmail.com> Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com> Reviewed-By: Refael Ackermann <refack@gmail.com>v6
Gunar C. Gessner
8 years ago
committed by
Refael Ackermann
7 changed files with 53 additions and 36 deletions
@ -1,10 +1,13 @@ |
|||||
// Flags: --expose-internals
|
// Flags: --expose-internals
|
||||
'use strict'; |
'use strict'; |
||||
|
|
||||
require('../common'); |
const common = require('../common'); |
||||
const assert = require('assert'); |
const assert = require('assert'); |
||||
const fs = require('internal/fs'); |
const fs = require('internal/fs'); |
||||
|
|
||||
assert.doesNotThrow(() => fs.assertEncoding()); |
assert.doesNotThrow(() => fs.assertEncoding()); |
||||
assert.doesNotThrow(() => fs.assertEncoding('utf8')); |
assert.doesNotThrow(() => fs.assertEncoding('utf8')); |
||||
assert.throws(() => fs.assertEncoding('foo'), /^Error: Unknown encoding: foo$/); |
common.expectsError( |
||||
|
() => fs.assertEncoding('foo'), |
||||
|
{code: 'ERR_INVALID_OPT_VALUE_ENCODING', type: TypeError} |
||||
|
); |
||||
|
Loading…
Reference in new issue