Skip to content

Commit

Permalink
test: use useful message argument in test function
Browse files Browse the repository at this point in the history
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 Dec 17, 2019
1 parent 1c9ba2c commit e52237d
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions test/sequential/test-inspector-async-call-stack.js
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down

0 comments on commit e52237d

Please sign in to comment.