mirror of https://github.com/lukechilds/node.git
Browse Source
* test reading a file passing a not valid enconding Refs: https://coverage.nodejs.org/coverage-067be658f966dafe/root/internal/fs.js.html PR-URL: https://github.com/nodejs/node/pull/10947 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com> Reviewed-By: Gibson Fahnestock <gibfahn@gmail.com>v6
committed by
Gibson Fahnestock
1 changed files with 13 additions and 0 deletions
@ -0,0 +1,13 @@ |
|||
'use strict'; |
|||
require('../common'); |
|||
|
|||
const assert = require('assert'); |
|||
const fs = require('fs'); |
|||
|
|||
const encoding = 'foo-8'; |
|||
const filename = 'bar.txt'; |
|||
|
|||
assert.throws( |
|||
fs.readFile.bind(fs, filename, { encoding }, () => {}), |
|||
new RegExp(`Error: Unknown encoding: ${encoding}$`) |
|||
); |
Loading…
Reference in new issue