invokeFlow runs both the onTrigger and onExecution functions of a CNI Flow definition in sequence. If the flow has no onTrigger, the default trigger payload is used. The result of the trigger is made available to onExecution via params.onTrigger.results.
invokeFlow is for testing Code Native Integration (CNI) flows. For testing individual actions, use invoke instead.
Config variable values to inject into context. String values are set directly; connection-shaped objects (with a fields property) are treated as ConnectionValue instances.
configVars: { "My String Config": "some-value", "My Connection": connectionValue(), // reads from PRISMATIC_CONNECTION_VALUE env var}
createMockContextComponents builds a mock components object for use in flow tests. It reads examplePayload from the component manifest to generate default mock responses, and accepts override functions for specific actions.
import { createMockContextComponents } from "@prismatic-io/spectral/dist/testing";const components = createMockContextComponents( // Component registry: keys are component names, values have an `actions` map { myComponent: myComponentManifest }, // Optional overrides for specific actions { actions: { myComponent: { myAction: () => Promise.resolve({ data: "custom mock" }), }, }, },);