stdout / stderr
Check what a CLI command printed to the terminal. Programs have two output streams: stdout (standard output) for normal messages and stderr (standard error) for errors and warnings.
stdout
# Check that stdout contains a substring
assertions:
- stdout:
contains: "migrated successfully"
# Check that stdout matches exactly
assertions:
- stdout:
equals: "Hello World\n"
stderr
# Check for a warning in error output
assertions:
- stderr:
contains: "warning"
# Assert that stderr is empty (no errors)
assertions:
- stderr:
equals: ""
contains vs equals: Use contains to check for a substring anywhere in the output. Use equals when the entire output must match exactly. In most cases, contains is more resilient to minor formatting changes.Only works with
executor: cli tests.