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
@@ -46,9 +46,9 @@ for (let i = 0; i < arr.length; i++)
|
||||
arr[i] = {};
|
||||
|
||||
assert.strictEqual(hook_result.destroy_called, false);
|
||||
setImmediate(() => {
|
||||
setImmediate(common.mustCall(() => {
|
||||
assert.strictEqual(hook_result.destroy_called, false);
|
||||
makeCallback(asyncResource, process, () => {
|
||||
makeCallback(asyncResource, process, common.mustCall(() => {
|
||||
const executionAsyncResource = async_hooks.executionAsyncResource();
|
||||
// Assuming the executionAsyncResource was created for the absence of the
|
||||
// initial `{ foo: 'bar' }`.
|
||||
@@ -58,8 +58,8 @@ setImmediate(() => {
|
||||
assert.strictEqual(typeof executionAsyncResource, 'object');
|
||||
assert.strictEqual(executionAsyncResource.foo, undefined);
|
||||
destroyAsyncResource(asyncResource);
|
||||
setImmediate(() => {
|
||||
setImmediate(common.mustCall(() => {
|
||||
assert.strictEqual(hook_result.destroy_called, true);
|
||||
});
|
||||
});
|
||||
});
|
||||
}));
|
||||
}));
|
||||
}));
|
||||
@@ -39,6 +39,6 @@ for (let i = 0; i < arr.length; i++)
|
||||
arr[i] = {};
|
||||
|
||||
assert.strictEqual(hook_result.destroy_called, false);
|
||||
setImmediate(() => {
|
||||
setImmediate(common.mustCall(() => {
|
||||
assert.strictEqual(hook_result.destroy_called, true);
|
||||
});
|
||||
}));
|
||||
@@ -40,7 +40,7 @@ const resourceWrap = createAsyncResource(
|
||||
|
||||
assert.strictEqual(hook_result.destroy_called, false);
|
||||
const recv = {};
|
||||
makeCallback(resourceWrap, recv, function callback() {
|
||||
makeCallback(resourceWrap, recv, common.mustCall(function callback() {
|
||||
assert.strictEqual(hook_result.destroy_called, false);
|
||||
assert.strictEqual(
|
||||
hook_result.resource,
|
||||
@@ -48,7 +48,7 @@ makeCallback(resourceWrap, recv, function callback() {
|
||||
);
|
||||
assert.strictEqual(this, recv);
|
||||
|
||||
setImmediate(() => {
|
||||
setImmediate(common.mustCall(() => {
|
||||
assert.strictEqual(hook_result.destroy_called, false);
|
||||
assert.notStrictEqual(
|
||||
hook_result.resource,
|
||||
@@ -56,8 +56,8 @@ makeCallback(resourceWrap, recv, function callback() {
|
||||
);
|
||||
|
||||
destroyAsyncResource(resourceWrap);
|
||||
setImmediate(() => {
|
||||
setImmediate(common.mustCall(() => {
|
||||
assert.strictEqual(hook_result.destroy_called, true);
|
||||
});
|
||||
});
|
||||
});
|
||||
}));
|
||||
}));
|
||||
}));
|
||||
Reference in new issue
Block a user