Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion test/es-module/test-import-module-retry-require-errored.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,4 @@ const assert = require('assert');
}, {
message: 'test',
});
})().catch(common.mustNotCall());
})().then(common.mustCall());
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,4 @@ assert.throws(() => {

assert.rejects(import('../fixtures/es-modules/throw-error.mjs'), {
message: 'test',
}).catch(common.mustNotCall());
}).then(common.mustCall());
2 changes: 1 addition & 1 deletion test/es-module/test-require-module-tla-retry-import-2.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,4 @@ async function test() {
}

// Run the test twice to check consistency after caching.
test().then(common.mustCall(test)).catch(common.mustNotCall());
test().then(common.mustCall(test));
2 changes: 1 addition & 1 deletion test/es-module/test-require-module-tla-retry-import.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,4 @@ async function test() {
}

// Run the test twice to check consistency after caching.
test().then(common.mustCall(test)).catch(common.mustNotCall());
test().then(common.mustCall(test));
2 changes: 1 addition & 1 deletion test/es-module/test-vm-main-context-default-loader-eval.js
Original file line number Diff line number Diff line change
Expand Up @@ -70,4 +70,4 @@ async function main() {
}
}

main().catch(common.mustNotCall());
main().then(common.mustCall());
2 changes: 1 addition & 1 deletion test/es-module/test-vm-main-context-default-loader.js
Original file line number Diff line number Diff line change
Expand Up @@ -116,4 +116,4 @@ async function main() {
}
}

main().catch(common.mustNotCall());
main().then(common.mustCall());
4 changes: 4 additions & 0 deletions test/eslint.config_partial.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,10 @@ export default [
selector: "ExpressionStatement>CallExpression:matches([callee.name='rejects'], [callee.object.name='assert'][callee.property.name='rejects'])",
message: 'Calling `assert.rejects` without `await` or `.then(common.mustCall())` will not detect never-settling promises.',
},
{
selector: 'CallExpression[callee.property.name="catch"]>:first-child:matches(CallExpression[callee.object.name="common"][callee.property.name="mustNotCall"], CallExpression[callee.name="mustNotCall"])',
message: 'Calling `.catch(common.mustNotCall())` will not detect never-settling promises. Use `.then(common.mustCall())` instead.',
},
],

// Stylistic rules.
Expand Down
2 changes: 1 addition & 1 deletion test/module-hooks/test-module-hooks-load-esm-mock.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,4 +48,4 @@ function hook(code, filename) {
assert.deepStrictEqual({ ...bar }, { $key: 'bar-esm' });
}

})().catch(common.mustNotCall());
})().then(common.mustCall());
2 changes: 1 addition & 1 deletion test/module-hooks/test-module-hooks-load-esm.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,4 +48,4 @@ function hook(code, filename) {
assert.deepStrictEqual({ ...bar }, { $key: 'bar-esm' });
}

})().catch(common.mustNotCall());
})().then(common.mustCall());
4 changes: 2 additions & 2 deletions test/parallel/test-crypto-async-sign-verify.js
Original file line number Diff line number Diff line change
Expand Up @@ -138,9 +138,9 @@ test('dsa_public.pem', 'dsa_private.pem', 'sha256', false,
verify('sha256', data, publicKey, signature),
verify('sha256', data, publicKey, signature),
verify('sha256', data, publicKey, signature),
]).then(common.mustCall());
]);
})
.catch(common.mustNotCall());
.then(common.mustCall());
}

{
Expand Down
2 changes: 1 addition & 1 deletion test/parallel/test-fs-open.js
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ async function promise() {
await (await fs.promises.open(__filename, 'r')).close();
}

promise().then(common.mustCall()).catch(common.mustNotCall());
promise().then(common.mustCall());

assert.throws(
() => fs.open(__filename, 'r', 'boom', common.mustNotCall()),
Expand Down
2 changes: 1 addition & 1 deletion test/parallel/test-stream-readable-async-iterators.js
Original file line number Diff line number Diff line change
Expand Up @@ -690,7 +690,7 @@ async function tests() {
const it = r[Symbol.asyncIterator]();
const p = it.return();
r.emit('close');
p.then(common.mustCall()).catch(common.mustNotCall());
p.then(common.mustCall());
}

{
Expand Down
2 changes: 1 addition & 1 deletion test/parallel/test-vm-context-dont-contextify.js
Original file line number Diff line number Diff line change
Expand Up @@ -182,4 +182,4 @@ function checkFrozen(context) {
const promise = script.runInContext(context);
assert.strictEqual(await promise, namespace);
}
})().catch(common.mustNotCall());
})().then(common.mustCall());
Loading