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-type.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-type.js')
-rw-r--r-- | test/parallel/test-fs-read-type.js | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/test/parallel/test-fs-read-type.js b/test/parallel/test-fs-read-type.js index e62405c48e..c6e3e53f05 100644 --- a/test/parallel/test-fs-read-type.js +++ b/test/parallel/test-fs-read-type.js @@ -13,9 +13,9 @@ assert.throws(() => { expected.length, 0, 'utf-8', - common.noop); -}, /Second argument needs to be a buffer/); + common.mustNotCall()); +}, /^TypeError: Second argument needs to be a buffer$/); assert.throws(() => { fs.readSync(fd, expected.length, 0, 'utf-8'); -}, /Second argument needs to be a buffer/); +}, /^TypeError: Second argument needs to be a buffer$/); |