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:
Antoine du Hamel committed 2025-11-12 00:15:32 +01:00
1 parent daaaf04a32
commit 2a85aa4e7b
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();
});
}));