Documentation
¶
Overview ¶
Package testkit provides flow-runner-specific test helpers.
This package is intentionally separate from github.com/nexssp/testkit: the generic testkit has no dependency on flow, and this package needs one. Keeping them apart means a project that never runs flows does not pull flow into its test binaries.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Result ¶
Result captures the outcome of one flow run inside a test.
Stdout and Stderr hold the exact bytes the runner would have written to the terminal, so a test can assert on the live trace, the metrics table, or the banner without spawning a subprocess.
func RunDSL ¶
RunDSL executes a flow body directly, without reading a .flow file.
The DSL is treated as if it were the content of a .flow file: it may contain @config, @pipeline, and @assert directives, but not @include or @require (those need a real file on disk).
payload is passed as the initial state. libs is the library set the DSL may call; pass at least flow.StandardLibrary().
func (Result) ExpectFailure ¶
ExpectFailure fails the test when the flow exited with code 0.
func (Result) ExpectSuccess ¶
ExpectSuccess fails the test when the flow did not exit cleanly.