From d64068a80fabfadf18d3b3e2e0aa802961d30a20 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Peter=20Scha=CC=88fer?= <101886095+PeterSchafer@users.noreply.github.com> Date: Tue, 20 Aug 2024 14:44:50 +0200 Subject: [PATCH] test: improve parallelization test --- test/jest/acceptance/parallel-execution.spec.ts | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/test/jest/acceptance/parallel-execution.spec.ts b/test/jest/acceptance/parallel-execution.spec.ts index 79509c78d7..3d8db14046 100644 --- a/test/jest/acceptance/parallel-execution.spec.ts +++ b/test/jest/acceptance/parallel-execution.spec.ts @@ -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[] = []; 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); } }); });