From ea6941f703a63c51beb7b59f1f5d803355188ffa Mon Sep 17 00:00:00 2001 From: Rich Trott Date: Thu, 25 May 2017 14:47:52 -0700 Subject: [PATCH] test: refactor test-fs-assert-encoding-error Check that callbacks are not executed when errors are expected to be thrown. PR-URL: https://github.com/nodejs/node/pull/13226 Reviewed-By: Gibson Fahnestock Reviewed-By: Refael Ackermann Reviewed-By: Luigi Pinca Reviewed-By: Colin Ihrig --- test/parallel/test-fs-assert-encoding-error.js | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/test/parallel/test-fs-assert-encoding-error.js b/test/parallel/test-fs-assert-encoding-error.js index b69bc4c5655a87..d1e0c273ad83fa 100644 --- a/test/parallel/test-fs-assert-encoding-error.js +++ b/test/parallel/test-fs-assert-encoding-error.js @@ -7,7 +7,7 @@ const options = 'test'; const unknownEncodingMessage = /^Error: Unknown encoding: test$/; assert.throws(() => { - fs.readFile('path', options, common.noop); + fs.readFile('path', options, common.mustNotCall()); }, unknownEncodingMessage); assert.throws(() => { @@ -15,7 +15,7 @@ assert.throws(() => { }, unknownEncodingMessage); assert.throws(() => { - fs.readdir('path', options, common.noop); + fs.readdir('path', options, common.mustNotCall()); }, unknownEncodingMessage); assert.throws(() => { @@ -23,7 +23,7 @@ assert.throws(() => { }, unknownEncodingMessage); assert.throws(() => { - fs.readlink('path', options, common.noop); + fs.readlink('path', options, common.mustNotCall()); }, unknownEncodingMessage); assert.throws(() => { @@ -31,7 +31,7 @@ assert.throws(() => { }, unknownEncodingMessage); assert.throws(() => { - fs.writeFile('path', 'data', options, common.noop); + fs.writeFile('path', 'data', options, common.mustNotCall()); }, unknownEncodingMessage); assert.throws(() => { @@ -39,7 +39,7 @@ assert.throws(() => { }, unknownEncodingMessage); assert.throws(() => { - fs.appendFile('path', 'data', options, common.noop); + fs.appendFile('path', 'data', options, common.mustNotCall()); }, unknownEncodingMessage); assert.throws(() => { @@ -47,11 +47,11 @@ assert.throws(() => { }, unknownEncodingMessage); assert.throws(() => { - fs.watch('path', options, common.noop); + fs.watch('path', options, common.mustNotCall()); }, unknownEncodingMessage); assert.throws(() => { - fs.realpath('path', options, common.noop); + fs.realpath('path', options, common.mustNotCall()); }, unknownEncodingMessage); assert.throws(() => { @@ -59,7 +59,7 @@ assert.throws(() => { }, unknownEncodingMessage); assert.throws(() => { - fs.mkdtemp('path', options, common.noop); + fs.mkdtemp('path', options, common.mustNotCall()); }, unknownEncodingMessage); assert.throws(() => {