mirror of
https://github.com/nodejs/node.git
synced 2026-11-27 17:52:27 -05:00
tools: add lint rule to ensure assertions are reached
PR-URL: https://github.com/nodejs/node/pull/60125 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Marco Ippolito <marcoippolito54@gmail.com>
This commit is contained in:
47 files changed
+458
-217
No files matched your search
@@ -39,15 +39,15 @@ test_hook.enable();
|
||||
* slots. Testing with plain object here.
|
||||
*/
|
||||
const resource = {};
|
||||
makeCallback(resource, process, function cb() {
|
||||
makeCallback(resource, process, common.mustCall(function cb() {
|
||||
assert.strictEqual(this, process);
|
||||
assert.strictEqual(async_hooks.executionAsyncResource(), resource);
|
||||
});
|
||||
}));
|
||||
|
||||
assert.strictEqual(hook_result.init_called, true);
|
||||
assert.strictEqual(hook_result.before_called, true);
|
||||
assert.strictEqual(hook_result.after_called, true);
|
||||
setImmediate(() => {
|
||||
setImmediate(common.mustCall(() => {
|
||||
assert.strictEqual(hook_result.destroy_called, true);
|
||||
test_hook.disable();
|
||||
});
|
||||
}));
|
||||
Reference in new issue
Block a user