Skip to content

Commit

Permalink
Merge pull request #113 from japneetlambdatest/dev
Browse files Browse the repository at this point in the history
changed to regex match
  • Loading branch information
japneetlambdatest authored Feb 25, 2022
2 parents 6082dad + 512f485 commit 1d25b64
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions commands/utils/validate.js
Original file line number Diff line number Diff line change
Expand Up @@ -174,14 +174,19 @@ module.exports = validate_config = function (lt_config, validation_configs) {
}

if (lt_config["run_settings"]["cypress_settings"] != "") {
for (let i = 0; i < validation_configs.blacklistCommands.length; i++) {
validation_configs.blacklistCommands[i] = new RegExp(
validation_configs.blacklistCommands[i]
);
}
let settings = lt_config["run_settings"]["cypress_settings"].split(";");
//let setting_names = [];
let settings_flag = true;
let setting_param = "";
for (let i = 0; i < settings.length; i++) {
if (
validation_configs.blacklistCommands.includes(
settings[i].split(" ")[0]
validation_configs.blacklistCommands.some((rx) =>
rx.test(settings[i].split(" ")[0])
)
) {
settings_flag = false;
Expand All @@ -201,7 +206,6 @@ module.exports = validate_config = function (lt_config, validation_configs) {
reject("Smart UI project name is missing");
} else if (lt_config.run_settings.smart_ui.project == "") {
reject("Smart UI porject name can not be blank");

}
}
resolve("Validated the Config");
Expand Down

0 comments on commit 1d25b64

Please sign in to comment.