Skip to content

Commit

Permalink
test: improve parallelization test
Browse files Browse the repository at this point in the history
  • Loading branch information
PeterSchafer committed Aug 20, 2024
1 parent 5803372 commit d64068a
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions test/jest/acceptance/parallel-execution.spec.ts
Original file line number Diff line number Diff line change
@@ -1,20 +1,23 @@
import { runSnykCLI } from '../util/runSnykCLI';
import { RunCommandResult } from '../util/runCommand';
import { createProject } from '../util/createProject';

jest.setTimeout(1000 * 120);

describe('Parallel CLI execution', () => {
it('parallel woof', async () => {
it('parallel test', async () => {
const numberOfParallelExecutions = 10;

const project = await createProject('npm/with-vulnerable-lodash-dep');

const singleTestResult: Promise<RunCommandResult>[] = [];
for (let i = 0; i < numberOfParallelExecutions; i++) {
singleTestResult.push(runSnykCLI(`woof -d`));
singleTestResult.push(runSnykCLI(`test -d`, { cwd: project.path() }));
}

for (let i = 0; i < numberOfParallelExecutions; i++) {
const { code } = await singleTestResult[i];
expect(code).toBe(0);
expect(code).toBe(1);
}
});
});

0 comments on commit d64068a

Please sign in to comment.