Skip to content
Permalink
Browse files

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: #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>
  • Loading branch information
Trott authored and MylesBorins committed Nov 24, 2019
1 parent 1c9ba2c commit e52237d66e573ea16ba469c0e1cd5279dd1d47d8
Showing with 6 additions and 4 deletions.
  1. +6 −4 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.

0 comments on commit e52237d

Please sign in to comment.
You can’t perform that action at this time.