Skip to content

Commit

Permalink
fix disable feature string; add timeout option (#204)
Browse files Browse the repository at this point in the history
* fix disable feature string; add timeout option

* revert package log

* update package-lock
  • Loading branch information
ryanjduffy authored Jul 5, 2023
1 parent bf82e36 commit d551f86
Show file tree
Hide file tree
Showing 6 changed files with 223 additions and 10 deletions.
13 changes: 10 additions & 3 deletions packages/cypress/bin/replayio-cypress.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ function commandInstall() {
});
}

function parseRetryCount(arg: string | undefined) {
function parseNumberArg(arg: string | undefined) {
const num = arg ? Number.parseInt(arg) : NaN;
if (isNaN(num)) {
throw new Error("Error: --count must be a number");
Expand All @@ -36,6 +36,7 @@ async function commandRun() {
let modeOpt: string | undefined;
let levelOpt: string | undefined;
let retryCount: number | undefined;
let timeout: number | undefined;

// TODO [ryanjduffy]: Migrate to commander
while (args.length) {
Expand All @@ -52,11 +53,16 @@ async function commandRun() {
levelOpt = args.shift();

continue;

case "-c":
case "--count":
args.shift();
retryCount = parseRetryCount(args.shift());
retryCount = parseNumberArg(args.shift());

continue;
case "-t":
case "--timeout":
args.shift();
timeout = parseNumberArg(args.shift());

continue;
}
Expand All @@ -79,6 +85,7 @@ async function commandRun() {
mode: mode === ReplayMode.RecordOnRetry ? SpecRepeatMode.Failed : SpecRepeatMode.All,
untilPasses: mode === ReplayMode.RecordOnRetry,
args,
timeout,
});

process.exit(failed ? 1 : 0);
Expand Down
157 changes: 153 additions & 4 deletions packages/cypress/package-lock.json

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

1 change: 1 addition & 0 deletions packages/cypress/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@
"chalk": "^4.1.2",
"debug": "^4.3.4",
"semver": "^7.5.2",
"terminate": "^2.6.1",
"uuid": "^8.3.2"
},
"peerDependencies": {
Expand Down
Loading

0 comments on commit d551f86

Please sign in to comment.