createTestMachine
Callable
Type parameters
- TContext: MachineContext
- TEvent: EventObject = AnyEventObject
- TTypesMeta: TypegenConstraint = TypegenDisabled
Parameters
config: TestMachineConfig<TContext, TEvent, TTypesMeta>
optionaloptions: Partial<Pick<{ actions?: MachineImplementationsActions<TContext, ResolveTypegenMeta<TTypesMeta, TEvent, any, ParameterizedObject, ParameterizedObject, string, string>, Prop<{ disabled: TypegenDisabled & AllImplementationsProvided & AllowAllEvents & { indexedActions: IndexByType<ParameterizedObject>; indexedActors: IndexByProp<any, src>; indexedDelays: IndexByType<{ type: string }>; indexedEvents: Record<string, TEvent>; indexedGuards: IndexByType<ParameterizedObject>; invokeSrcNameMap: Record<string, string>; tags: string }; enabled: TTypesMeta & { indexedActions: IsNever<Prop<TTypesMeta, eventsCausingActions>> extends true ? never : Record<keyof Prop<TTypesMeta, eventsCausingActions>, ParameterizedObject>; indexedActors: Record<keyof Prop<TTypesMeta, eventsCausingActors>, { logic: AnyActorLogic }>; indexedDelays: IsNever<Prop<TTypesMeta, eventsCausingDelays>> extends true ? never : Record<keyof Prop<TTypesMeta, eventsCausingDelays>, ParameterizedObject>; indexedEvents: MergeWithInternalEvents<IndexByType<string extends TEvent[type] ? never : TEvent>, Prop<TTypesMeta, internalEvents>>; indexedGuards: IsNever<Prop<TTypesMeta, eventsCausingGuards>> extends true ? never : Record<keyof Prop<TTypesMeta, eventsCausingGuards>, ParameterizedObject>; tags: Prop<TTypesMeta, tags> } }[IsNever<TTypesMeta> extends true ? disabled : TTypesMeta[@@xstate/typegen] extends true ? enabled : disabled], eventsCausingActions>, Prop<{ disabled: TypegenDisabled & AllImplementationsProvided & AllowAllEvents & { indexedActions: IndexByType<ParameterizedObject>; indexedActors: IndexByProp<any, src>; indexedDelays: IndexByType<{ type: string }>; indexedEvents: Record<string, TEvent>; indexedGuards: IndexByType<ParameterizedObject>; invokeSrcNameMap: Record<string, string>; tags: string }; enabled: TTypesMeta & { indexedActions: IsNever<Prop<TTypesMeta, eventsCausingActions>> extends true ? never : Record<keyof Prop<TTypesMeta, eventsCausingActions>, ParameterizedObject>; indexedActors: Record<keyof Prop<TTypesMeta, eventsCausingActors>, { logic: AnyActorLogic }>; indexedDelays: IsNever<Prop<TTypesMeta, eventsCausingDelays>> extends true ? never : Record<keyof Prop<TTypesMeta, eventsCausingDelays>, ParameterizedObject>; indexedEvents: MergeWithInternalEvents<IndexByType<string extends TEvent[type] ? never : TEvent>, Prop<TTypesMeta, internalEvents>>; indexedGuards: IsNever<Prop<TTypesMeta, eventsCausingGuards>> extends true ? never : Record<keyof Prop<TTypesMeta, eventsCausingGuards>, ParameterizedObject>; tags: Prop<TTypesMeta, tags> } }[IsNever<TTypesMeta> extends true ? disabled : TTypesMeta[@@xstate/typegen] extends true ? enabled : disabled], indexedEvents>, Prop<{ disabled: TypegenDisabled & AllImplementationsProvided & AllowAllEvents & { indexedActions: IndexByType<ParameterizedObject>; indexedActors: IndexByProp<any, src>; indexedDelays: IndexByType<{ type: string }>; indexedEvents: Record<string, TEvent>; indexedGuards: IndexByType<ParameterizedObject>; invokeSrcNameMap: Record<string, string>; tags: string }; enabled: TTypesMeta & { indexedActions: IsNever<Prop<TTypesMeta, eventsCausingActions>> extends true ? never : Record<keyof Prop<TTypesMeta, eventsCausingActions>, ParameterizedObject>; indexedActors: Record<keyof Prop<TTypesMeta, eventsCausingActors>, { logic: AnyActorLogic }>; indexedDelays: IsNever<Prop<TTypesMeta, eventsCausingDelays>> extends true ? never : Record<keyof Prop<TTypesMeta, eventsCausingDelays>, ParameterizedObject>; indexedEvents: MergeWithInternalEvents<IndexByType<string extends TEvent[type] ? never : TEvent>, Prop<TTypesMeta, internalEvents>>; indexedGuards: IsNever<Prop<TTypesMeta, eventsCausingGuards>> extends true ? never : Record<keyof Prop<TTypesMeta, eventsCausingGuards>, ParameterizedObject>; tags: Prop<TTypesMeta, tags> } }[IsNever<TTypesMeta> extends true ? disabled : TTypesMeta[@@xstate/typegen] extends true ? enabled : disabled], indexedActors>, Prop<{ disabled: TypegenDisabled & AllImplementationsProvided & AllowAllEvents & { indexedActions: IndexByType<ParameterizedObject>; indexedActors: IndexByProp<any, src>; indexedDelays: IndexByType<{ type: string }>; indexedEvents: Record<string, TEvent>; indexedGuards: IndexByType<ParameterizedObject>; invokeSrcNameMap: Record<string, string>; tags: string }; enabled: TTypesMeta & { indexedActions: IsNever<Prop<TTypesMeta, eventsCausingActions>> extends true ? never : Record<keyof Prop<TTypesMeta, eventsCausingActions>, ParameterizedObject>; indexedActors: Record<keyof Prop<TTypesMeta, eventsCausingActors>, { logic: AnyActorLogic }>; indexedDelays: IsNever<Prop<TTypesMeta, eventsCausingDelays>> extends true ? never : Record<keyof Prop<TTypesMeta, eventsCausingDelays>, ParameterizedObject>; indexedEvents: MergeWithInternalEvents<IndexByType<string extends TEvent[type] ? never : TEvent>, Prop<TTypesMeta, internalEvents>>; indexedGuards: IsNever<Prop<TTypesMeta, eventsCausingGuards>> extends true ? never : Record<keyof Prop<TTypesMeta, eventsCausingGuards>, ParameterizedObject>; tags: Prop<TTypesMeta, tags> } }[IsNever<TTypesMeta> extends true ? disabled : TTypesMeta[@@xstate/typegen] extends true ? enabled : disabled], indexedActions>, Prop<{ disabled: TypegenDisabled & AllImplementationsProvided & AllowAllEvents & { indexedActions: IndexByType<ParameterizedObject>; indexedActors: IndexByProp<any, src>; indexedDelays: IndexByType<{ type: string }>; indexedEvents: Record<string, TEvent>; indexedGuards: IndexByType<ParameterizedObject>; invokeSrcNameMap: Record<string, string>; tags: string }; enabled: TTypesMeta & { indexedActions: IsNever<Prop<TTypesMeta, eventsCausingActions>> extends true ? never : Record<keyof Prop<TTypesMeta, eventsCausingActions>, ParameterizedObject>; indexedActors: Record<keyof Prop<TTypesMeta, eventsCausingActors>, { logic: AnyActorLogic }>; indexedDelays: IsNever<Prop<TTypesMeta, eventsCausingDelays>> extends true ? never : Record<keyof Prop<TTypesMeta, eventsCausingDelays>, ParameterizedObject>; indexedEvents: MergeWithInternalEvents<IndexByType<string extends TEvent[type] ? never : TEvent>, Prop<TTypesMeta, internalEvents>>; indexedGuards: IsNever<Prop<TTypesMeta, eventsCausingGuards>> extends true ? never : Record<keyof Prop<TTypesMeta, eventsCausingGuards>, ParameterizedObject>; tags: Prop<TTypesMeta, tags> } }[IsNever<TTypesMeta> extends true ? disabled : TTypesMeta[@@xstate/typegen] extends true ? enabled : disabled], indexedGuards>, Prop<{ disabled: TypegenDisabled & AllImplementationsProvided & AllowAllEvents & { indexedActions: IndexByType<ParameterizedObject>; indexedActors: IndexByProp<any, src>; indexedDelays: IndexByType<{ type: string }>; indexedEvents: Record<string, TEvent>; indexedGuards: IndexByType<ParameterizedObject>; invokeSrcNameMap: Record<string, string>; tags: string }; enabled: TTypesMeta & { indexedActions: IsNever<Prop<TTypesMeta, eventsCausingActions>> extends true ? never : Record<keyof Prop<TTypesMeta, eventsCausingActions>, ParameterizedObject>; indexedActors: Record<keyof Prop<TTypesMeta, eventsCausingActors>, { logic: AnyActorLogic }>; indexedDelays: IsNever<Prop<TTypesMeta, eventsCausingDelays>> extends true ? never : Record<keyof Prop<TTypesMeta, eventsCausingDelays>, ParameterizedObject>; indexedEvents: MergeWithInternalEvents<IndexByType<string extends TEvent[type] ? never : TEvent>, Prop<TTypesMeta, internalEvents>>; indexedGuards: IsNever<Prop<TTypesMeta, eventsCausingGuards>> extends true ? never : Record<keyof Prop<TTypesMeta, eventsCausingGuards>, ParameterizedObject>; tags: Prop<TTypesMeta, tags> } }[IsNever<TTypesMeta> extends true ? disabled : TTypesMeta[@@xstate/typegen] extends true ? enabled : disabled], indexedDelays>>; actors?: MachineImplementationsActors<TContext, ResolveTypegenMeta<TTypesMeta, TEvent, any, ParameterizedObject, ParameterizedObject, string, string>, Prop<{ disabled: TypegenDisabled & AllImplementationsProvided & AllowAllEvents & { indexedActions: IndexByType<ParameterizedObject>; indexedActors: IndexByProp<any, src>; indexedDelays: IndexByType<{ type: string }>; indexedEvents: Record<string, TEvent>; indexedGuards: IndexByType<ParameterizedObject>; invokeSrcNameMap: Record<string, string>; tags: string }; enabled: TTypesMeta & { indexedActions: IsNever<Prop<TTypesMeta, eventsCausingActions>> extends true ? never : Record<keyof Prop<TTypesMeta, eventsCausingActions>, ParameterizedObject>; indexedActors: Record<keyof Prop<TTypesMeta, eventsCausingActors>, { logic: AnyActorLogic }>; indexedDelays: IsNever<Prop<TTypesMeta, eventsCausingDelays>> extends true ? never : Record<keyof Prop<TTypesMeta, eventsCausingDelays>, ParameterizedObject>; indexedEvents: MergeWithInternalEvents<IndexByType<string extends TEvent[type] ? never : TEvent>, Prop<TTypesMeta, internalEvents>>; indexedGuards: IsNever<Prop<TTypesMeta, eventsCausingGuards>> extends true ? never : Record<keyof Prop<TTypesMeta, eventsCausingGuards>, ParameterizedObject>; tags: Prop<TTypesMeta, tags> } }[IsNever<TTypesMeta> extends true ? disabled : TTypesMeta[@@xstate/typegen] extends true ? enabled : disabled], indexedActors>, Prop<{ disabled: TypegenDisabled & AllImplementationsProvided & AllowAllEvents & { indexedActions: IndexByType<ParameterizedObject>; indexedActors: IndexByProp<any, src>; indexedDelays: IndexByType<{ type: string }>; indexedEvents: Record<string, TEvent>; indexedGuards: IndexByType<ParameterizedObject>; invokeSrcNameMap: Record<string, string>; tags: string }; enabled: TTypesMeta & { indexedActions: IsNever<Prop<TTypesMeta, eventsCausingActions>> extends true ? never : Record<keyof Prop<TTypesMeta, eventsCausingActions>, ParameterizedObject>; indexedActors: Record<keyof Prop<TTypesMeta, eventsCausingActors>, { logic: AnyActorLogic }>; indexedDelays: IsNever<Prop<TTypesMeta, eventsCausingDelays>> extends true ? never : Record<keyof Prop<TTypesMeta, eventsCausingDelays>, ParameterizedObject>; indexedEvents: MergeWithInternalEvents<IndexByType<string extends TEvent[type] ? never : TEvent>, Prop<TTypesMeta, internalEvents>>; indexedGuards: IsNever<Prop<TTypesMeta, eventsCausingGuards>> extends true ? never : Record<keyof Prop<TTypesMeta, eventsCausingGuards>, ParameterizedObject>; tags: Prop<TTypesMeta, tags> } }[IsNever<TTypesMeta> extends true ? disabled : TTypesMeta[@@xstate/typegen] extends true ? enabled : disabled], invokeSrcNameMap>>; delays?: MachineImplementationsDelays<TContext, ResolveTypegenMeta<TTypesMeta, TEvent, any, ParameterizedObject, ParameterizedObject, string, string>, Prop<{ disabled: TypegenDisabled & AllImplementationsProvided & AllowAllEvents & { indexedActions: IndexByType<ParameterizedObject>; indexedActors: IndexByProp<any, src>; indexedDelays: IndexByType<{ type: string }>; indexedEvents: Record<string, TEvent>; indexedGuards: IndexByType<ParameterizedObject>; invokeSrcNameMap: Record<string, string>; tags: string }; enabled: TTypesMeta & { indexedActions: IsNever<Prop<TTypesMeta, eventsCausingActions>> extends true ? never : Record<keyof Prop<TTypesMeta, eventsCausingActions>, ParameterizedObject>; indexedActors: Record<keyof Prop<TTypesMeta, eventsCausingActors>, { logic: AnyActorLogic }>; indexedDelays: IsNever<Prop<TTypesMeta, eventsCausingDelays>> extends true ? never : Record<keyof Prop<TTypesMeta, eventsCausingDelays>, ParameterizedObject>; indexedEvents: MergeWithInternalEvents<IndexByType<string extends TEvent[type] ? never : TEvent>, Prop<TTypesMeta, internalEvents>>; indexedGuards: IsNever<Prop<TTypesMeta, eventsCausingGuards>> extends true ? never : Record<keyof Prop<TTypesMeta, eventsCausingGuards>, ParameterizedObject>; tags: Prop<TTypesMeta, tags> } }[IsNever<TTypesMeta> extends true ? disabled : TTypesMeta[@@xstate/typegen] extends true ? enabled : disabled], eventsCausingDelays>, Prop<{ disabled: TypegenDisabled & AllImplementationsProvided & AllowAllEvents & { indexedActions: IndexByType<ParameterizedObject>; indexedActors: IndexByProp<any, src>; indexedDelays: IndexByType<{ type: string }>; indexedEvents: Record<string, TEvent>; indexedGuards: IndexByType<ParameterizedObject>; invokeSrcNameMap: Record<string, string>; tags: string }; enabled: TTypesMeta & { indexedActions: IsNever<Prop<TTypesMeta, eventsCausingActions>> extends true ? never : Record<keyof Prop<TTypesMeta, eventsCausingActions>, ParameterizedObject>; indexedActors: Record<keyof Prop<TTypesMeta, eventsCausingActors>, { logic: AnyActorLogic }>; indexedDelays: IsNever<Prop<TTypesMeta, eventsCausingDelays>> extends true ? never : Record<keyof Prop<TTypesMeta, eventsCausingDelays>, ParameterizedObject>; indexedEvents: MergeWithInternalEvents<IndexByType<string extends TEvent[type] ? never : TEvent>, Prop<TTypesMeta, internalEvents>>; indexedGuards: IsNever<Prop<TTypesMeta, eventsCausingGuards>> extends true ? never : Record<keyof Prop<TTypesMeta, eventsCausingGuards>, ParameterizedObject>; tags: Prop<TTypesMeta, tags> } }[IsNever<TTypesMeta> extends true ? disabled : TTypesMeta[@@xstate/typegen] extends true ? enabled : disabled], indexedEvents>, Prop<{ disabled: TypegenDisabled & AllImplementationsProvided & AllowAllEvents & { indexedActions: IndexByType<ParameterizedObject>; indexedActors: IndexByProp<any, src>; indexedDelays: IndexByType<{ type: string }>; indexedEvents: Record<string, TEvent>; indexedGuards: IndexByType<ParameterizedObject>; invokeSrcNameMap: Record<string, string>; tags: string }; enabled: TTypesMeta & { indexedActions: IsNever<Prop<TTypesMeta, eventsCausingActions>> extends true ? never : Record<keyof Prop<TTypesMeta, eventsCausingActions>, ParameterizedObject>; indexedActors: Record<keyof Prop<TTypesMeta, eventsCausingActors>, { logic: AnyActorLogic }>; indexedDelays: IsNever<Prop<TTypesMeta, eventsCausingDelays>> extends true ? never : Record<keyof Prop<TTypesMeta, eventsCausingDelays>, ParameterizedObject>; indexedEvents: MergeWithInternalEvents<IndexByType<string extends TEvent[type] ? never : TEvent>, Prop<TTypesMeta, internalEvents>>; indexedGuards: IsNever<Prop<TTypesMeta, eventsCausingGuards>> extends true ? never : Record<keyof Prop<TTypesMeta, eventsCausingGuards>, ParameterizedObject>; tags: Prop<TTypesMeta, tags> } }[IsNever<TTypesMeta> extends true ? disabled : TTypesMeta[@@xstate/typegen] extends true ? enabled : disabled], indexedActions>, Prop<{ disabled: TypegenDisabled & AllImplementationsProvided & AllowAllEvents & { indexedActions: IndexByType<ParameterizedObject>; indexedActors: IndexByProp<any, src>; indexedDelays: IndexByType<{ type: string }>; indexedEvents: Record<string, TEvent>; indexedGuards: IndexByType<ParameterizedObject>; invokeSrcNameMap: Record<string, string>; tags: string }; enabled: TTypesMeta & { indexedActions: IsNever<Prop<TTypesMeta, eventsCausingActions>> extends true ? never : Record<keyof Prop<TTypesMeta, eventsCausingActions>, ParameterizedObject>; indexedActors: Record<keyof Prop<TTypesMeta, eventsCausingActors>, { logic: AnyActorLogic }>; indexedDelays: IsNever<Prop<TTypesMeta, eventsCausingDelays>> extends true ? never : Record<keyof Prop<TTypesMeta, eventsCausingDelays>, ParameterizedObject>; indexedEvents: MergeWithInternalEvents<IndexByType<string extends TEvent[type] ? never : TEvent>, Prop<TTypesMeta, internalEvents>>; indexedGuards: IsNever<Prop<TTypesMeta, eventsCausingGuards>> extends true ? never : Record<keyof Prop<TTypesMeta, eventsCausingGuards>, ParameterizedObject>; tags: Prop<TTypesMeta, tags> } }[IsNever<TTypesMeta> extends true ? disabled : TTypesMeta[@@xstate/typegen] extends true ? enabled : disabled], indexedDelays>>; guards?: MachineImplementationsGuards<TContext, ResolveTypegenMeta<TTypesMeta, TEvent, any, ParameterizedObject, ParameterizedObject, string, string>, Prop<{ disabled: TypegenDisabled & AllImplementationsProvided & AllowAllEvents & { indexedActions: IndexByType<ParameterizedObject>; indexedActors: IndexByProp<any, src>; indexedDelays: IndexByType<{ type: string }>; indexedEvents: Record<string, TEvent>; indexedGuards: IndexByType<ParameterizedObject>; invokeSrcNameMap: Record<string, string>; tags: string }; enabled: TTypesMeta & { indexedActions: IsNever<Prop<TTypesMeta, eventsCausingActions>> extends true ? never : Record<keyof Prop<TTypesMeta, eventsCausingActions>, ParameterizedObject>; indexedActors: Record<keyof Prop<TTypesMeta, eventsCausingActors>, { logic: AnyActorLogic }>; indexedDelays: IsNever<Prop<TTypesMeta, eventsCausingDelays>> extends true ? never : Record<keyof Prop<TTypesMeta, eventsCausingDelays>, ParameterizedObject>; indexedEvents: MergeWithInternalEvents<IndexByType<string extends TEvent[type] ? never : TEvent>, Prop<TTypesMeta, internalEvents>>; indexedGuards: IsNever<Prop<TTypesMeta, eventsCausingGuards>> extends true ? never : Record<keyof Prop<TTypesMeta, eventsCausingGuards>, ParameterizedObject>; tags: Prop<TTypesMeta, tags> } }[IsNever<TTypesMeta> extends true ? disabled : TTypesMeta[@@xstate/typegen] extends true ? enabled : disabled], eventsCausingGuards>, Prop<{ disabled: TypegenDisabled & AllImplementationsProvided & AllowAllEvents & { indexedActions: IndexByType<ParameterizedObject>; indexedActors: IndexByProp<any, src>; indexedDelays: IndexByType<{ type: string }>; indexedEvents: Record<string, TEvent>; indexedGuards: IndexByType<ParameterizedObject>; invokeSrcNameMap: Record<string, string>; tags: string }; enabled: TTypesMeta & { indexedActions: IsNever<Prop<TTypesMeta, eventsCausingActions>> extends true ? never : Record<keyof Prop<TTypesMeta, eventsCausingActions>, ParameterizedObject>; indexedActors: Record<keyof Prop<TTypesMeta, eventsCausingActors>, { logic: AnyActorLogic }>; indexedDelays: IsNever<Prop<TTypesMeta, eventsCausingDelays>> extends true ? never : Record<keyof Prop<TTypesMeta, eventsCausingDelays>, ParameterizedObject>; indexedEvents: MergeWithInternalEvents<IndexByType<string extends TEvent[type] ? never : TEvent>, Prop<TTypesMeta, internalEvents>>; indexedGuards: IsNever<Prop<TTypesMeta, eventsCausingGuards>> extends true ? never : Record<keyof Prop<TTypesMeta, eventsCausingGuards>, ParameterizedObject>; tags: Prop<TTypesMeta, tags> } }[IsNever<TTypesMeta> extends true ? disabled : TTypesMeta[@@xstate/typegen] extends true ? enabled : disabled], indexedEvents>, Prop<{ disabled: TypegenDisabled & AllImplementationsProvided & AllowAllEvents & { indexedActions: IndexByType<ParameterizedObject>; indexedActors: IndexByProp<any, src>; indexedDelays: IndexByType<{ type: string }>; indexedEvents: Record<string, TEvent>; indexedGuards: IndexByType<ParameterizedObject>; invokeSrcNameMap: Record<string, string>; tags: string }; enabled: TTypesMeta & { indexedActions: IsNever<Prop<TTypesMeta, eventsCausingActions>> extends true ? never : Record<keyof Prop<TTypesMeta, eventsCausingActions>, ParameterizedObject>; indexedActors: Record<keyof Prop<TTypesMeta, eventsCausingActors>, { logic: AnyActorLogic }>; indexedDelays: IsNever<Prop<TTypesMeta, eventsCausingDelays>> extends true ? never : Record<keyof Prop<TTypesMeta, eventsCausingDelays>, ParameterizedObject>; indexedEvents: MergeWithInternalEvents<IndexByType<string extends TEvent[type] ? never : TEvent>, Prop<TTypesMeta, internalEvents>>; indexedGuards: IsNever<Prop<TTypesMeta, eventsCausingGuards>> extends true ? never : Record<keyof Prop<TTypesMeta, eventsCausingGuards>, ParameterizedObject>; tags: Prop<TTypesMeta, tags> } }[IsNever<TTypesMeta> extends true ? disabled : TTypesMeta[@@xstate/typegen] extends true ? enabled : disabled], indexedGuards>> }, actions | guards>>
Returns StateMachine<MachineContext, AnyEventObject, Record<string, AnyActorRef>, ProvidedActor, ParameterizedObject, ParameterizedObject, string, StateValue, string, unknown, NonReducibleUnknown, ResolveTypegenMeta<TypegenDisabled, AnyEventObject, ProvidedActor, ParameterizedObject, ParameterizedObject, string, string>>