diff options
author | Rich Trott <rtrott@gmail.com> | 2017-06-06 09:53:32 -0700 |
---|---|---|
committer | Rich Trott <rtrott@gmail.com> | 2017-06-08 12:48:09 -0700 |
commit | 7fbeebac9679f16b20e2fa9933e1c71410afe30f (patch) | |
tree | bd215c8fbb1f22f776d53dd16623a69ea4f903d7 /test/parallel/test-fs-read-file-assert-encoding.js | |
parent | 6318078d2cb9980c4dc218d7fbe658cb77454165 (diff) | |
download | android-node-v8-7fbeebac9679f16b20e2fa9933e1c71410afe30f.tar.gz android-node-v8-7fbeebac9679f16b20e2fa9933e1c71410afe30f.tar.bz2 android-node-v8-7fbeebac9679f16b20e2fa9933e1c71410afe30f.zip |
test: refactor test-fs-read-*
* Use `common.mustNotCall()` in place of `common.noop` where appropriate
* Increase specificity of regular expressions (that is, make them match
the whole error string rather than part of the error string) in
`assert.throws()` calls
PR-URL: https://github.com/nodejs/node/pull/13501
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.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 | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/test/parallel/test-fs-read-file-assert-encoding.js b/test/parallel/test-fs-read-file-assert-encoding.js index 929caf88bd..ac0f45f98b 100644 --- a/test/parallel/test-fs-read-file-assert-encoding.js +++ b/test/parallel/test-fs-read-file-assert-encoding.js @@ -8,6 +8,6 @@ const encoding = 'foo-8'; const filename = 'bar.txt'; assert.throws( - fs.readFile.bind(fs, filename, { encoding }, common.noop), - new RegExp(`Error: Unknown encoding: ${encoding}$`) + fs.readFile.bind(fs, filename, { encoding }, common.mustNotCall()), + new RegExp(`^Error: Unknown encoding: ${encoding}$`) ); |