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 targos committed Dec 1, 2019
1 parent c50e4f9 commit 8a63ea1
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 8a63ea1

Please sign in to comment.