Skip to content

spawn test expect

Usage

spawn test expect <name>

Runs a test and saves its output as the new expected result for future comparisons.

  • <name> — The test directory name
  1. Runs the specified test
  2. Captures the output
  3. Writes it to tests/<name>/expected

Use this command when test behavior changes intentionally and you want to update the baseline for spawn test compare.

test expect always masks secret() values so real secrets cannot be written into the saved expected file. See the Secrets guide for details.

Terminal window
spawn test expect user-creation

Options

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.