Skip to main content

MockFluidDataStoreRuntime Class

Mock implementation of IRuntime for testing that does nothing

This API is provided for existing users, but is not recommended for new users.

To use, import via @fluidframework/test-runtime-utils/legacy.

For more information about our API support guarantees, see here.

Sealed

This type is "sealed," meaning that code outside of the library defining it should not implement or extend it. Future versions of this type may add members or make typing of readonly members more specific.

Signature​

/** @sealed */
export declare class MockFluidDataStoreRuntime extends EventEmitter implements IFluidDataStoreRuntime, IFluidDataStoreChannel, IFluidHandleContext

Extends: EventEmitter

Implements: IFluidDataStoreRuntime, IFluidDataStoreChannel, IFluidHandleContext

Constructors​

ConstructorAlertsDescription
(constructor)(overrides)BetaConstructs a new instance of the MockFluidDataStoreRuntime class

Properties​

PropertyAlertsModifiersTypeDescription
absolutePathBetareadonlystring
attachStateBetareadonlyAttachState
channelsRoutingContextBetareadonlyIFluidHandleContext
clientIdBetastring
connectedBetareadonly
containerRuntimeBetaoptionalMockContainerRuntime
deltaManagerBetareadonlyIDeltaManagerErased
deltaManagerInternalBetaMockDeltaManager
disposedBetareadonlyboolean
documentIdBetareadonlystring
entryPointBetareadonlyIFluidHandleInternal<FluidObject>
existingBetareadonlyboolean
idBetareadonlystring
idCompressorBetaIIdCompressor | undefined
IFluidHandleContextBetareadonlyIFluidHandleContext
ILayerCompatDetailsBetaoptionalunknown
inStagingModeBetareadonlyboolean
isAttachedBetareadonlyboolean
isDirtyBetareadonlyboolean
isReadOnlyBetareadonly() => boolean
loaderBetareadonlyILoader
localDeprecated, BetabooleanWhether the data store is local (not attached).
loggerBetareadonlyITelemetryBaseLogger
minVersionForCollabBetareadonlyOldestSupportedClientVersion
objectsRoutingContextBetareadonlyIFluidHandleContext
optionsBetaRecord<string | number, any>
pathBetareadonly
quorumBetaMockQuorumClients
rootRoutingContextBetareadonlyIFluidHandleContext
submitSignalBetaIFluidDataStoreRuntime["submitSignal"]
visibilityStateBetareadonlyVisibilityState

Methods​

MethodAlertsModifiersReturn TypeDescription
addChannel(channel)Betavoid
applyStashedOp(content)BetaPromise<unknown>
attachGraph()Betavoid
bind(handle)Betavoid
bindChannel(channel)Betavoid
close()BetaPromise<void>
createChannel(id, type)BetaIChannel
createDeltaConnection()BetaMockDeltaConnection
dispose()Betavoid
getAttachGCData(telemetryContext)BetaIGarbageCollectionData
getAttachSnapshot()BetaITreeEntry[]
getAttachSummary()BetaISummaryTreeWithStats
getAudience()BetaIAudience
getBlob(blobId)BetaPromise<any>
getChannel(id)BetaPromise<IChannel>
getGCData()BetaPromise<IGarbageCollectionData>
getQuorum()BetaIQuorumClients
makeVisibleAndAttachGraph()Betavoid
notifyReadOnlyState(readonly)Betavoid
processMessages(messageCollection)Betavoid
processSignal(message, local)Betavoid
request(request)BetaPromise<IResponse>
requestDataStore(request)BetaPromise<IResponse>
resolveHandle(request)BetaPromise<IResponse>
reSubmit(content, localOpMetadata, squash)Betavoid
rollback(message, localOpMetadata)Betaoptionalvoid
save(message)Betavoid
setAttachState(attachState)Betavoid
setConnectionState(connected, clientId)Betavoid
summarize(fullTree, trackState)BetaPromise<ISummaryTreeWithStats>
updateMinSequenceNumber(value)Betavoid
updateUsedRoutes(usedRoutes)Betavoid
uploadBlob(blob)BetaPromise<IFluidHandle<ArrayBufferLike>>
waitAttached()BetaPromise<void>

Constructor Details​

(constructor)​

Constructs a new instance of the MockFluidDataStoreRuntime class

This API is provided for existing users, but is not recommended for new users.

For more information about our API support guarantees, see here.

Signature​

constructor(overrides?: {
clientId?: string;
entryPoint?: IFluidHandle<FluidObject>;
id?: string;
logger?: ITelemetryBaseLogger;
idCompressor?: IIdCompressor;
attachState?: AttachState;
registry?: readonly IChannelFactory[];
minVersionForCollab?: OldestSupportedClientVersion;
inStagingMode?: boolean;
isDirty?: boolean;
});

Parameters​

ParameterModifiersTypeDescription
overridesoptional{ clientId?: string; entryPoint?: IFluidHandle<FluidObject>; id?: string; logger?: ITelemetryBaseLogger; idCompressor?: IIdCompressor; attachState?: AttachState; registry?: readonly IChannelFactory[]; minVersionForCollab?: OldestSupportedClientVersion; inStagingMode?: boolean; isDirty?: boolean; }

Property Details​

absolutePath​

This API is provided for existing users, but is not recommended for new users.

For more information about our API support guarantees, see here.

Signature​

get absolutePath(): string;

Type: string

attachState​

This API is provided for existing users, but is not recommended for new users.

For more information about our API support guarantees, see here.

Signature​

get attachState(): AttachState;

Type: AttachState

channelsRoutingContext​

This API is provided for existing users, but is not recommended for new users.

For more information about our API support guarantees, see here.

Signature​

get channelsRoutingContext(): IFluidHandleContext;

Type: IFluidHandleContext

clientId​

This API is provided for existing users, but is not recommended for new users.

For more information about our API support guarantees, see here.

Signature​

clientId: string;

Type: string

connected​

This API is provided for existing users, but is not recommended for new users.

For more information about our API support guarantees, see here.

Signature​

readonly connected = true;

containerRuntime​

This API is provided for existing users, but is not recommended for new users.

For more information about our API support guarantees, see here.

Signature​

containerRuntime?: MockContainerRuntime;

Type: MockContainerRuntime

deltaManager​

This API is provided for existing users, but is not recommended for new users.

For more information about our API support guarantees, see here.

Signature​

get deltaManager(): IDeltaManagerErased;

Type: IDeltaManagerErased

deltaManagerInternal​

This API is provided for existing users, but is not recommended for new users.

For more information about our API support guarantees, see here.

Signature​

deltaManagerInternal: MockDeltaManager;

Type: MockDeltaManager

disposed​

This API is provided for existing users, but is not recommended for new users.

For more information about our API support guarantees, see here.

Signature​

get disposed(): boolean;

Type: boolean

documentId​

This API is provided for existing users, but is not recommended for new users.

For more information about our API support guarantees, see here.

Signature​

readonly documentId: string;

Type: string

entryPoint​

This API is provided for existing users, but is not recommended for new users.

For more information about our API support guarantees, see here.

Signature​

readonly entryPoint: IFluidHandleInternal<FluidObject>;

Type: IFluidHandleInternal<FluidObject>

existing​

This API is provided for existing users, but is not recommended for new users.

For more information about our API support guarantees, see here.

Signature​

readonly existing: boolean;

Type: boolean

id​

This API is provided for existing users, but is not recommended for new users.

For more information about our API support guarantees, see here.

Signature​

readonly id: string;

Type: string

idCompressor​

This API is provided for existing users, but is not recommended for new users.

For more information about our API support guarantees, see here.

Signature​

idCompressor: IIdCompressor | undefined;

Type: IIdCompressor | undefined

IFluidHandleContext​

This API is provided for existing users, but is not recommended for new users.

For more information about our API support guarantees, see here.

Signature​

get IFluidHandleContext(): IFluidHandleContext;

Type: IFluidHandleContext

ILayerCompatDetails​

This API is provided for existing users, but is not recommended for new users.

For more information about our API support guarantees, see here.

Signature​

ILayerCompatDetails?: unknown;

Type: unknown

Remarks​

This is for internal use only.

inStagingMode​

This API is provided for existing users, but is not recommended for new users.

For more information about our API support guarantees, see here.

Signature​

readonly inStagingMode: boolean;

Type: boolean

isAttached​

This API is provided for existing users, but is not recommended for new users.

For more information about our API support guarantees, see here.

Signature​

get isAttached(): boolean;

Type: boolean

isDirty​

This API is provided for existing users, but is not recommended for new users.

For more information about our API support guarantees, see here.

Signature​

readonly isDirty: boolean;

Type: boolean

isReadOnly​

This API is provided for existing users, but is not recommended for new users.

For more information about our API support guarantees, see here.

Signature​

readonly isReadOnly: () => boolean;

Type: () => boolean

loader​

This API is provided for existing users, but is not recommended for new users.

For more information about our API support guarantees, see here.

Signature​

readonly loader: ILoader;

Type: ILoader

local​

Whether the data store is local (not attached).

This API is deprecated and will be removed in a future release.

Use attachState instead

This API is provided for existing users, but is not recommended for new users.

For more information about our API support guarantees, see here.

Signature​

get local(): boolean;

set local(local: boolean);

Type: boolean

logger​

This API is provided for existing users, but is not recommended for new users.

For more information about our API support guarantees, see here.

Signature​

readonly logger: ITelemetryBaseLogger;

Type: ITelemetryBaseLogger

minVersionForCollab​

This API is provided for existing users, but is not recommended for new users.

For more information about our API support guarantees, see here.

Signature​

readonly minVersionForCollab: OldestSupportedClientVersion;

Type: OldestSupportedClientVersion

See Also​

IFluidDataStoreRuntimeInternalConfig.minVersionForCollab

objectsRoutingContext​

This API is provided for existing users, but is not recommended for new users.

For more information about our API support guarantees, see here.

Signature​

get objectsRoutingContext(): IFluidHandleContext;

Type: IFluidHandleContext

options​

This API is provided for existing users, but is not recommended for new users.

For more information about our API support guarantees, see here.

Signature​

options: Record<string | number, any>;

Type: Record<string | number, any>

path​

This API is provided for existing users, but is not recommended for new users.

For more information about our API support guarantees, see here.

Signature​

readonly path = "";

quorum​

This API is provided for existing users, but is not recommended for new users.

For more information about our API support guarantees, see here.

Signature​

quorum: MockQuorumClients;

Type: MockQuorumClients

rootRoutingContext​

This API is provided for existing users, but is not recommended for new users.

For more information about our API support guarantees, see here.

Signature​

get rootRoutingContext(): IFluidHandleContext;

Type: IFluidHandleContext

submitSignal​

This API is provided for existing users, but is not recommended for new users.

For more information about our API support guarantees, see here.

Signature​

submitSignal: IFluidDataStoreRuntime["submitSignal"];

Type: IFluidDataStoreRuntime["submitSignal"]

visibilityState​

This API is provided for existing users, but is not recommended for new users.

For more information about our API support guarantees, see here.

Signature​

get visibilityState(): VisibilityState;

Type: VisibilityState

Method Details​

addChannel​

This API is provided for existing users, but is not recommended for new users.

For more information about our API support guarantees, see here.

Signature​

addChannel(channel: IChannel): void;

Parameters​

ParameterTypeDescription
channelIChannel

applyStashedOp​

This API is provided for existing users, but is not recommended for new users.

For more information about our API support guarantees, see here.

Signature​

applyStashedOp(content: any): Promise<unknown>;

Parameters​

ParameterTypeDescription
contentany

Returns​

Return type: Promise<unknown>

attachGraph​

This API is provided for existing users, but is not recommended for new users.

For more information about our API support guarantees, see here.

Signature​

attachGraph(): void;

bind​

This API is provided for existing users, but is not recommended for new users.

For more information about our API support guarantees, see here.

Signature​

bind(handle: IFluidHandle): void;

Parameters​

ParameterTypeDescription
handleIFluidHandle

bindChannel​

This API is provided for existing users, but is not recommended for new users.

For more information about our API support guarantees, see here.

Signature​

bindChannel(channel: IChannel): void;

Parameters​

ParameterTypeDescription
channelIChannel

close​

This API is provided for existing users, but is not recommended for new users.

For more information about our API support guarantees, see here.

Signature​

close(): Promise<void>;

Returns​

Return type: Promise<void>

createChannel​

This API is provided for existing users, but is not recommended for new users.

For more information about our API support guarantees, see here.

Signature​

createChannel(id: string | undefined, type: string): IChannel;

Parameters​

ParameterTypeDescription
idstring | undefined
typestring

Returns​

Return type: IChannel

createDeltaConnection​

This API is provided for existing users, but is not recommended for new users.

For more information about our API support guarantees, see here.

Signature​

createDeltaConnection(): MockDeltaConnection;

Returns​

Return type: MockDeltaConnection

dispose​

This API is provided for existing users, but is not recommended for new users.

For more information about our API support guarantees, see here.

Signature​

dispose(): void;

getAttachGCData​

This API is provided for existing users, but is not recommended for new users.

For more information about our API support guarantees, see here.

Signature​

getAttachGCData(telemetryContext?: ITelemetryContext | undefined): IGarbageCollectionData;

Parameters​

ParameterModifiersTypeDescription
telemetryContextoptionalITelemetryContext | undefined

Returns​

Return type: IGarbageCollectionData

getAttachSnapshot​

This API is provided for existing users, but is not recommended for new users.

For more information about our API support guarantees, see here.

Signature​

getAttachSnapshot(): ITreeEntry[];

Returns​

Return type: ITreeEntry[]

getAttachSummary​

This API is provided for existing users, but is not recommended for new users.

For more information about our API support guarantees, see here.

Signature​

getAttachSummary(): ISummaryTreeWithStats;

Returns​

Return type: ISummaryTreeWithStats

getAudience​

This API is provided for existing users, but is not recommended for new users.

For more information about our API support guarantees, see here.

Signature​

getAudience(): IAudience;

Returns​

Return type: IAudience

getBlob​

This API is provided for existing users, but is not recommended for new users.

For more information about our API support guarantees, see here.

Signature​

getBlob(blobId: string): Promise<any>;

Parameters​

ParameterTypeDescription
blobIdstring

Returns​

Return type: Promise<any>

getChannel​

This API is provided for existing users, but is not recommended for new users.

For more information about our API support guarantees, see here.

Signature​

getChannel(id: string): Promise<IChannel>;

Parameters​

ParameterTypeDescription
idstring

Returns​

Return type: Promise<IChannel>

getGCData​

This API is provided for existing users, but is not recommended for new users.

For more information about our API support guarantees, see here.

Signature​

getGCData(): Promise<IGarbageCollectionData>;

Returns​

Return type: Promise<IGarbageCollectionData>

getQuorum​

This API is provided for existing users, but is not recommended for new users.

For more information about our API support guarantees, see here.

Signature​

getQuorum(): IQuorumClients;

Returns​

Return type: IQuorumClients

makeVisibleAndAttachGraph​

This API is provided for existing users, but is not recommended for new users.

For more information about our API support guarantees, see here.

Signature​

makeVisibleAndAttachGraph(): void;

notifyReadOnlyState​

This API is provided for existing users, but is not recommended for new users.

For more information about our API support guarantees, see here.

Signature​

notifyReadOnlyState(readonly: boolean): void;

Parameters​

ParameterTypeDescription
readonlyboolean

processMessages​

This API is provided for existing users, but is not recommended for new users.

For more information about our API support guarantees, see here.

Signature​

processMessages(messageCollection: IRuntimeMessageCollection): void;

Parameters​

ParameterTypeDescription
messageCollectionIRuntimeMessageCollection

processSignal​

This API is provided for existing users, but is not recommended for new users.

For more information about our API support guarantees, see here.

Signature​

processSignal(message: any, local: boolean): void;

Parameters​

ParameterTypeDescription
messageany
localboolean

request​

This API is provided for existing users, but is not recommended for new users.

For more information about our API support guarantees, see here.

Signature​

request(request: IRequest): Promise<IResponse>;

Parameters​

ParameterTypeDescription
requestIRequest

Returns​

Return type: Promise<IResponse>

requestDataStore​

This API is provided for existing users, but is not recommended for new users.

For more information about our API support guarantees, see here.

Signature​

requestDataStore(request: IRequest): Promise<IResponse>;

Parameters​

ParameterTypeDescription
requestIRequest

Returns​

Return type: Promise<IResponse>

resolveHandle​

This API is provided for existing users, but is not recommended for new users.

For more information about our API support guarantees, see here.

Signature​

resolveHandle(request: IRequest): Promise<IResponse>;

Parameters​

ParameterTypeDescription
requestIRequest

Returns​

Return type: Promise<IResponse>

reSubmit​

This API is provided for existing users, but is not recommended for new users.

For more information about our API support guarantees, see here.

Signature​

reSubmit(content: any, localOpMetadata: unknown, squash: boolean): void;

Parameters​

ParameterTypeDescription
contentany
localOpMetadataunknown
squashboolean

rollback​

This API is provided for existing users, but is not recommended for new users.

For more information about our API support guarantees, see here.

Signature​

rollback?(message: any, localOpMetadata: unknown): void;

Parameters​

ParameterTypeDescription
messageany
localOpMetadataunknown

save​

This API is provided for existing users, but is not recommended for new users.

For more information about our API support guarantees, see here.

Signature​

save(message: string): void;

Parameters​

ParameterTypeDescription
messagestring

setAttachState​

This API is provided for existing users, but is not recommended for new users.

For more information about our API support guarantees, see here.

Signature​

setAttachState(attachState: AttachState.Attaching | AttachState.Attached): void;

Parameters​

ParameterTypeDescription
attachStateAttachState.Attaching | AttachState.Attached

setConnectionState​

This API is provided for existing users, but is not recommended for new users.

For more information about our API support guarantees, see here.

Signature​

setConnectionState(connected: boolean, clientId?: string): void;

Parameters​

ParameterModifiersTypeDescription
connectedboolean
clientIdoptionalstring

summarize​

This API is provided for existing users, but is not recommended for new users.

For more information about our API support guarantees, see here.

Signature​

summarize(fullTree?: boolean, trackState?: boolean): Promise<ISummaryTreeWithStats>;

Parameters​

ParameterModifiersTypeDescription
fullTreeoptionalboolean
trackStateoptionalboolean

Returns​

Return type: Promise<ISummaryTreeWithStats>

updateMinSequenceNumber​

This API is provided for existing users, but is not recommended for new users.

For more information about our API support guarantees, see here.

Signature​

updateMinSequenceNumber(value: number): void;

Parameters​

ParameterTypeDescription
valuenumber

updateUsedRoutes​

This API is provided for existing users, but is not recommended for new users.

For more information about our API support guarantees, see here.

Signature​

updateUsedRoutes(usedRoutes: string[]): void;

Parameters​

ParameterTypeDescription
usedRoutesstring[]

uploadBlob​

This API is provided for existing users, but is not recommended for new users.

For more information about our API support guarantees, see here.

Signature​

uploadBlob(blob: ArrayBufferLike): Promise<IFluidHandle<ArrayBufferLike>>;

Parameters​

ParameterTypeDescription
blobArrayBufferLike

Returns​

Return type: Promise<IFluidHandle<ArrayBufferLike>>

waitAttached​

This API is provided for existing users, but is not recommended for new users.

For more information about our API support guarantees, see here.

Signature​

waitAttached(): Promise<void>;

Returns​

Return type: Promise<void>