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 its output
  3. 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.

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.