diff --git a/test/client-proxy/test-http-proxy-request-invalid-char-in-url.mjs b/test/client-proxy/test-http-proxy-request-invalid-char-in-url.mjs index 1b5f586b2923d4..c9254c8f094ed2 100644 --- a/test/client-proxy/test-http-proxy-request-invalid-char-in-url.mjs +++ b/test/client-proxy/test-http-proxy-request-invalid-char-in-url.mjs @@ -12,16 +12,16 @@ import { Worker } from 'node:worker_threads'; const expectedProxyLogs = new Set(); const proxyWorker = new Worker(fixtures.path('proxy-server-worker.js')); -proxyWorker.on('message', (message) => { +proxyWorker.on('message', common.mustCall((message) => { console.log('Received message from worker:', message.type); if (message.type === 'proxy-listening') { - startTest(message.port); + startTest(message.port).then(common.mustCall()); } else if (message.type === 'proxy-stopped') { assert.deepStrictEqual(new Set(message.logs), expectedProxyLogs); // Close the server after the proxy is stopped. proxyWorker.terminate(); } -}); +}, 2)); const requests = new Set(); // Create a server that records the requests it gets. @@ -74,7 +74,7 @@ async function startTest(proxyPort) { 'proxy-connection': 'close', }, }); - http.request(url, (res) => { + http.request(url, common.mustCall((res) => { res.on('error', common.mustNotCall()); res.setEncoding('utf8'); res.on('data', () => {}); @@ -88,6 +88,6 @@ async function startTest(proxyPort) { proxyWorker.postMessage({ type: 'stop-proxy' }); } })); - }).on('error', common.mustNotCall()).end(); + })).on('error', common.mustNotCall()).end(); } } diff --git a/test/client-proxy/test-https-proxy-request-invalid-char-in-url.mjs b/test/client-proxy/test-https-proxy-request-invalid-char-in-url.mjs index 10b308c3406829..b5e16e8254f553 100644 --- a/test/client-proxy/test-https-proxy-request-invalid-char-in-url.mjs +++ b/test/client-proxy/test-https-proxy-request-invalid-char-in-url.mjs @@ -67,7 +67,7 @@ for (const testCase of testCases) { url: severHost, headers: { host: severHost }, }); - https.request(url, (res) => { + https.request(url, common.mustCall((res) => { res.on('error', common.mustNotCall()); res.setEncoding('utf8'); res.on('data', (data) => { @@ -77,14 +77,14 @@ for (const testCase of testCases) { console.log(`[Proxy client] #${++counter} closed request for: ${inspect(url)}`); // Finished all test cases. if (counter === testCases.length) { - setImmediate(() => { + setImmediate(common.mustCall(() => { console.log('All requests completed, shutting down.'); proxy.close(); server.close(); assert.deepStrictEqual(requests, expectedUrls); assert.deepStrictEqual(new Set(logs), expectedProxyLogs); - }); + })); } })); - }).on('error', common.mustNotCall()).end(); + })).on('error', common.mustNotCall()).end(); } diff --git a/test/eslint.config_partial.mjs b/test/eslint.config_partial.mjs index 592e047b609662..915a8b97b347ef 100644 --- a/test/eslint.config_partial.mjs +++ b/test/eslint.config_partial.mjs @@ -156,7 +156,7 @@ export default [ }, { files: [ - 'test/{async-hooks,message,module-hooks,node-api,pummel,pseudo-tty,v8-updates,wasi}/**/*.{js,mjs,cjs}', + 'test/{async-hooks,benchmark,cctest,client-proxy,message,module-hooks,node-api,pummel,pseudo-tty,v8-updates,wasi}/**/*.{js,mjs,cjs}', ], rules: { 'node-core/must-call-assert': 'error',