Skip to content

FR: Wait for string/regex to show up in server output #316

Description

@anishkny

Feature Request

Allow waiting on some string/regex to appear in the server output text (stdout/stderr) instead of port/URL to be used.

Some servers may not allow configuring or determining which port they use, or may not even use ports. Seems like the only way to determine if such a server has started is via some text appearing on stdout/stderr.

For example when using stripe-cli to listen to webhooks locally for testing, we only get the output:

⣟ Getting ready... > Ready! Your webhook signing secret is whsec_xxxxxxxxxxxx (^C to quit)

It would be nice to have something like:

{
    "scripts": {
        "start": "stripe listen ...",
        "test": "./run-tests.sh",

        // Wait for regex /Ready!/ to appear in output of "npm start":
        "ci": "start-server-and-test start /Ready!/ test" 
    }
}

See related stripe/stripe-cli#756.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions