test: use useful message argument in test function

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 <trivikr.dev@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Yongsheng Zhang <zyszys98@gmail.com>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
pull/30618/head
Rich Trott 2019-11-23 21:13:52 -08:00
parent f2060fa9e6
commit a6fd2828c6
1 changed files with 6 additions and 4 deletions

View File

@ -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.