Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Increase delay between inputs on some acceptance tests #3073

Merged
merged 1 commit into from
Mar 29, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions test/jest/acceptance/snyk-apps/create-app.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ describe('snyk-apps: create app', () => {
} = await runSnykCLIWithUserInputs(
'apps create --interactive --experimental',
[testData.appName, ENTER, testData.redirectURIs, ENTER, ENTER],
{ env },
{ env, delay: 200 },
);
// Assert
expect(stdout).toContain("Your Snyk App's permission scopes");
Expand Down Expand Up @@ -158,7 +158,7 @@ describe('snyk-apps: create app', () => {
testData.orgId,
ENTER,
],
{ env },
{ env, delay: 200 },
);
// Assert
expect(code).toBe(0);
Expand Down
6 changes: 4 additions & 2 deletions test/jest/util/runCommand.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,9 @@ type RunCommandResult = {
stderr: string;
};

type RunCommandOptions = SpawnOptionsWithoutStdio;
interface RunCommandOptions extends SpawnOptionsWithoutStdio {
delay?: number;
}

const runCommand = (
command: string,
Expand Down Expand Up @@ -47,7 +49,7 @@ function runCommandsWithUserInputs(
inputs: string[] = [],
options?: RunCommandOptions,
): Promise<any> {
const timeout = 100;
const timeout = options?.delay ?? 100;
const childProcess = spawn(command, args, options);

// Creates a loop to feed user inputs to the child process
Expand Down