spawn test expect
Usage
spawn test expect <name> Runs a test and saves its output as the new expected result for future comparisons.
Arguments
Section titled “Arguments”<name>— The test directory name
Behavior
Section titled “Behavior”- Runs the specified test
- Captures its output
- Writes it to
tests/<name>/expected
Everything the test produced goes in that one file: query output first, then any NOTICE, WARNING or error messages. See spawn test compare for the format.
Use this command when test behavior changes intentionally and you want to update the baseline for spawn test compare.
Secrets
Section titled “Secrets”test expect always masks secret() values so real secrets cannot be written into the saved expected file. See the Secrets guide for details.
Example
Section titled “Example”spawn test expect user-creationOptions
| Option | Description |
|---|---|
-e, --environment <name> | Override the environment for the target config. |
--target <name> | Select which target from spawn.toml to use. |
--config-file <path> | Path to config file. Defaults to spawn.toml. |
-d, --debug | Turn on debug output. |