diff options
Diffstat (limited to 'test/parallel/test-http2-server-settimeout-no-callback.js')
-rw-r--r-- | test/parallel/test-http2-server-settimeout-no-callback.js | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/test/parallel/test-http2-server-settimeout-no-callback.js b/test/parallel/test-http2-server-settimeout-no-callback.js index a43fbb2129..5dff0fa8e7 100644 --- a/test/parallel/test-http2-server-settimeout-no-callback.js +++ b/test/parallel/test-http2-server-settimeout-no-callback.js @@ -6,23 +6,23 @@ if (!common.hasCrypto) const assert = require('assert'); const http2 = require('http2'); +const { inspect } = require('util'); // Verify that setTimeout callback verifications work correctly const verifyCallbacks = (server) => { const testTimeout = 10; - const notFunctions = [true, 1, {}, [], null, 'test']; - const invalidCallBackError = { - type: TypeError, - code: 'ERR_INVALID_CALLBACK', - message: 'Callback must be a function' - }; - notFunctions.forEach((notFunction) => + [true, 1, {}, [], null, 'test'].forEach((notFunction) => { common.expectsError( () => server.setTimeout(testTimeout, notFunction), - invalidCallBackError - ) - ); + { + type: TypeError, + code: 'ERR_INVALID_CALLBACK', + message: 'Callback must be a function. ' + + `Received ${inspect(notFunction)}` + } + ); + }); // No callback const returnedVal = server.setTimeout(testTimeout); |