From e52237d66e573ea16ba469c0e1cd5279dd1d47d8 Mon Sep 17 00:00:00 2001 From: Rich Trott Date: Sat, 23 Nov 2019 21:13:52 -0800 Subject: [PATCH] test: use useful message argument in test function MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The message argument of two test functions in test-inspector-async-call-stack is useful but unused. Use it! PR-URL: https://github.com/nodejs/node/pull/30618 Reviewed-By: Trivikram Kamat Reviewed-By: Luigi Pinca Reviewed-By: Colin Ihrig Reviewed-By: Yongsheng Zhang Reviewed-By: Tobias Nießen --- test/sequential/test-inspector-async-call-stack.js | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/test/sequential/test-inspector-async-call-stack.js b/test/sequential/test-inspector-async-call-stack.js index f6a48b339d4cc8..f050487da7a5e5 100644 --- a/test/sequential/test-inspector-async-call-stack.js +++ b/test/sequential/test-inspector-async-call-stack.js @@ -6,18 +6,20 @@ common.skipIf32Bits(); const assert = require('assert'); const { internalBinding } = require('internal/test/binding'); -const async_wrap = internalBinding('async_wrap'); -const { kTotals } = async_wrap.constants; +const { async_hook_fields, constants } = internalBinding('async_wrap'); +const { kTotals } = constants; const inspector = require('inspector'); const setDepth = 'Debugger.setAsyncCallStackDepth'; function verifyAsyncHookDisabled(message) { - assert.strictEqual(async_wrap.async_hook_fields[kTotals], 0); + assert.strictEqual(async_hook_fields[kTotals], 0, + `${async_hook_fields[kTotals]} !== 0: ${message}`); } function verifyAsyncHookEnabled(message) { - assert.strictEqual(async_wrap.async_hook_fields[kTotals], 4); + assert.strictEqual(async_hook_fields[kTotals], 4, + `${async_hook_fields[kTotals]} !== 4: ${message}`); } // By default inspector async hooks should not have been installed.