Skip to content

Commit 5e5d5ae

Browse files
authored
Merge pull request #312 from HRanjan-11/CYP-956
add usenode18 flag
2 parents 6e5d834 + 55c8c28 commit 5e5d5ae

File tree

3 files changed

+22
-0
lines changed

3 files changed

+22
-0
lines changed

commands/utils/set_args.js

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -373,6 +373,16 @@ function sync_args_from_cmd(args) {
373373
lt_config["run_settings"]["network_http2"] = false;
374374
}
375375

376+
if ("useNode18" in args) {
377+
if (args["useNode18"] == "true") {
378+
lt_config.run_settings.useNode18 = true;
379+
} else {
380+
lt_config.run_settings.useNode18 = false;
381+
}
382+
} else if (lt_config["run_settings"]["useNode18"] && !lt_config["run_settings"]["useNode18"]) {
383+
lt_config["run_settings"]["useNode18"] = false;
384+
}
385+
376386
if ("network_ws" in args) {
377387
if (args["network_ws"] == "true") {
378388
lt_config.run_settings.network_ws = true;

commands/utils/validate.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -198,6 +198,13 @@ module.exports = validate_config = function (lt_config, validation_configs) {
198198
}
199199
}
200200

201+
//validate if network_http2 field contains expected value
202+
if ("useNode18" in lt_config["run_settings"]) {
203+
if (![true, false].includes(lt_config["run_settings"]["useNode18"])) {
204+
reject("Error!! boolean value is expected in useNode18 key");
205+
}
206+
}
207+
201208
if (
202209
"downloads" in lt_config["run_settings"] &&
203210
lt_config["run_settings"]["downloads"] != ""

index.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -236,6 +236,11 @@ const argv = require("yargs")
236236
describe: "Bypass web socket calls for Network logs",
237237
type: "bool",
238238
})
239+
.option("node18", {
240+
alias: "useNode18",
241+
describe: "Use node version 18 for cypress",
242+
type: "bool",
243+
})
239244
.option("net_sse", {
240245
alias: "network_sse",
241246
describe: "Bypass sse events calls for Network logs",

0 commit comments

Comments
 (0)