Skip to content

Commit

Permalink
Merge pull request #279 from LambdaTest/dev
Browse files Browse the repository at this point in the history
Release 1 dec
  • Loading branch information
HRanjan-11 authored Dec 1, 2023
2 parents 2bc5b41 + 33da5d2 commit 834ab4e
Show file tree
Hide file tree
Showing 4 changed files with 35 additions and 7 deletions.
27 changes: 27 additions & 0 deletions commands/utils/utils.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
function split_at_pattern(s, pattern) {
const res = [];
let beg = 0;
let inString = false;

for (let i = 0; i < s.length; i++) {
if (s[i] === pattern && !inString) {
res.push(s.substring(beg, i));
beg = i + 1;
} else if (s[i] === '"') {
if (!inString) {
inString = true;
} else if (i > 0 && s[i - 1] !== '\\') {
inString = false;
}
}
}

res.push(s.substring(beg));
return res;
}


module.exports = {
split_at_pattern: split_at_pattern,
};

9 changes: 5 additions & 4 deletions commands/utils/validate.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
const fs = require("fs");
const semver = require("semver");
const semverCompare = require("semver/functions/compare");
const { split_at_pattern } = require("./utils.js");

const constants = require("./constants.js");
module.exports = validate_config = function (lt_config, validation_configs) {
Expand Down Expand Up @@ -208,18 +209,18 @@ module.exports = validate_config = function (lt_config, validation_configs) {
validation_configs.blacklistCommands[i]
);
}
let settings = lt_config["run_settings"]["cypress_settings"].split(";");
//let setting_names = [];
let settings = split_at_pattern(lt_config["run_settings"]["cypress_settings"], ';')
let settings_flag = true;
let setting_param = "";
for (let i = 0; i < settings.length; i++) {
let configs = split_at_pattern(settings[i],' ')
if (
validation_configs.blacklistCommands.some((rx) =>
rx.test(settings[i].split(" ")[0])
rx.test(configs[0])
)
) {
settings_flag = false;
setting_param = settings[i].split(" ")[0];
setting_param = configs[0];
break;
}
}
Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "lambdatest-cypress-cli",
"version": "3.0.21",
"version": "3.0.22",
"description": "The lambdatest-cypress-cli is LambdaTest's command-line interface (CLI) aimed to help you run your Cypress tests on LambdaTest platform.",
"homepage": "https://github.com/LambdaTest/lambdatest-cypress-cli",
"author": "LambdaTest <[email protected]>",
Expand Down

0 comments on commit 834ab4e

Please sign in to comment.