test: replace foreach with for in test-https-simple.js

Fixes: https://github.com/nodejs/node/issues/50818
PR-URL: https://github.com/nodejs/node/pull/49793
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
Reviewed-By: Jithil P Ponnan <jithil@outlook.com>
This commit is contained in:
Shikha Mehta 2023-11-23 08:34:46 -08:00 committed by GitHub
parent f9675e104e
commit 4e713a3930
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -45,13 +45,13 @@ const serverCallback = common.mustCall(function(req, res) {
});
const invalid_options = [ 'foo', 42, true, [] ];
invalid_options.forEach((option) => {
for (const option of invalid_options) {
assert.throws(() => {
new https.Server(option);
}, {
code: 'ERR_INVALID_ARG_TYPE',
});
});
}
const server = https.createServer(options, serverCallback);