diff options
author | Ruben Bridgewater <ruben@bridgewater.de> | 2017-06-20 23:20:10 +0200 |
---|---|---|
committer | Refael Ackermann <refack@gmail.com> | 2017-07-22 18:18:04 -0400 |
commit | 095357e26efc366b1cca389306e0780cc1fa81d9 (patch) | |
tree | 428cb86546dca71248b43a318d9afd15b508d9c4 /test/parallel/test-fs-read-file-assert-encoding.js | |
parent | 8979b4fc9face199099a53f32dfeb14a1203ad57 (diff) | |
download | android-node-v8-095357e26efc366b1cca389306e0780cc1fa81d9.tar.gz android-node-v8-095357e26efc366b1cca389306e0780cc1fa81d9.tar.bz2 android-node-v8-095357e26efc366b1cca389306e0780cc1fa81d9.zip |
lib: tweak use of internal/errors
In addition refactor common.throws to common.expectsError
PR-URL: https://github.com/nodejs/node/pull/13829
Refs: https://github.com/nodejs/node/issues/11273
Reviewed-By: Refael Ackermann <refack@gmail.com>
Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Diffstat (limited to 'test/parallel/test-fs-read-file-assert-encoding.js')
-rw-r--r-- | test/parallel/test-fs-read-file-assert-encoding.js | 10 |
1 files changed, 2 insertions, 8 deletions
diff --git a/test/parallel/test-fs-read-file-assert-encoding.js b/test/parallel/test-fs-read-file-assert-encoding.js index 4770db6eb7..2640355b56 100644 --- a/test/parallel/test-fs-read-file-assert-encoding.js +++ b/test/parallel/test-fs-read-file-assert-encoding.js @@ -1,17 +1,11 @@ 'use strict'; const common = require('../common'); -const assert = require('assert'); const fs = require('fs'); const encoding = 'foo-8'; const filename = 'bar.txt'; -const expectedError = common.expectsError({ - code: 'ERR_INVALID_OPT_VALUE_ENCODING', - type: TypeError, -}); - -assert.throws( +common.expectsError( fs.readFile.bind(fs, filename, { encoding }, common.mustNotCall()), - expectedError + { code: 'ERR_INVALID_OPT_VALUE_ENCODING', type: TypeError } ); |