Rulvar API reference / @rulvar/testing / runLiveSmoke
Function: runLiveSmoke()
ts
function runLiveSmoke(
adapter,
req,
options?): Promise<LiveSmokeOutcome>;Defined in: packages/testing/src/live.ts:124
Drains adapter.stream(req) with a bounded retry policy and classifies the outcome instead of throwing:
'ok': the stream ended on a single terminalfinish(the events of the successful attempt are included for further assertions).'failed': a terminal error withretryable: false; never retried, diagnostics preserved.'exhausted': every attempt ended in aretryable: trueerror; the per-attempt errors are preserved in order.'no-terminal': the stream ended with neitherfinishnorerror, which violates the provider SPI; never retried (spending again on a misbehaving adapter is wrong).'contract-violation': the stream carried more than one terminal event ('multiple-terminals', e.g. an error followed by a finish) or its single terminal was not the final event ('terminal-not-final'). Equally an SPI violation, equally never retried, and never reported as a pass.
Retries only ever follow a well-formed stream whose single final terminal is a typed retryable error, so a live smoke never converts a real adapter failure or a malformed stream into a pass and never spends more than attempts calls. Options are validated first: invalid attempts or baseDelayMs reject with ConfigError before any adapter call.
Parameters
| Parameter | Type |
|---|---|
adapter | Pick<ProviderAdapter, "stream"> |
req | ChatRequest |
options? | RunLiveSmokeOptions |
Returns
Promise<LiveSmokeOutcome>