Skip to content

[Feature Request] Add success condition all but first #280

@woody34

Description

@woody34

Description

I would like to add a third success condition that would allow you to spin up a service, complete a list of tasks in parallel, capture their exit status. Assuming all tasks exited successfully, exit application with success status.

Use case

I currently use concurrently to spin up storybook and complete cypress tests against a component library. I would like to be able to also perform jest visual regression tests.

Proposed Use Case

const concurrently = require('concurrently');
const waitForStorybook = 'npx wait-on http://localhost:6006/';
concurrently(
	[
		{ name: 'Storybook', command: 'npm:sb', prefixColor: 'bgMagenta.bold' },
		{ name: 'Cypress', command: `${waitForStorybook} && npm run test:cypress:run`, prefixColor: 'bgGreen.bold' },
		{ name: 'Jest', command: `${waitForStorybook} && npm run test:unit`, prefixColor: 'bgBlue.bold' },
	],
	{
		prefix: 'name',
		successCondition: 'all-but-first',
	},
)
	.catch(console.error);

I am currently nesting concurrently calls to achieve this behavior and it doesn't provide the best logs.

Proposed Acceptance Criteria

  1. run 3 tasks concurrently
  2. once task 2 and 3 complete with success, exit app with success

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions