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.

Signature

export declare class MockFluidDataStoreRuntime extends EventEmitter implements IFluidDataStoreRuntime, IFluidDataStoreChannel, IFluidHandleContext

Extends: EventEmitter

Implements: IFluidDataStoreRuntime, IFluidDataStoreChannel, IFluidHandleContext

Constructors

Constructor Alerts Description
(constructor)(overrides) Beta Constructs a new instance of the MockFluidDataStoreRuntime class

Properties

Property Alerts Modifiers Type Description
absolutePath Beta readonly string
attachState Beta readonly AttachState
channelsRoutingContext Beta readonly IFluidHandleContext
clientId Beta string
connected Beta readonly
containerRuntime Beta optional MockContainerRuntime
deltaManager Beta readonly IDeltaManagerErased
deltaManagerInternal Beta MockDeltaManager
disposed Beta readonly boolean
documentId Beta readonly string
entryPoint Beta readonly IFluidHandleInternal<FluidObject>
existing Beta readonly boolean
id Beta readonly string
idCompressor Beta (IIdCompressor & IIdCompressorCore) | undefined
IFluidHandleContext Beta readonly IFluidHandleContext
ILayerCompatDetails Beta optional unknown
isAttached Beta readonly boolean
isReadOnly Beta readonly () => boolean
loader Beta readonly ILoader
local Deprecated, Beta boolean
logger Beta readonly ITelemetryBaseLogger
objectsRoutingContext Beta readonly IFluidHandleContext
options Beta Record<string | number, any>
path Beta readonly
quorum Beta MockQuorumClients
rootRoutingContext Beta readonly IFluidHandleContext
visibilityState Beta readonly VisibilityState

Methods

Method Alerts Modifiers Return Type Description
addChannel(channel) Beta void
applyStashedOp(content) Beta Promise<unknown>
attachGraph() Beta void
bind(handle) Beta void
bindChannel(channel) Beta void
close() Beta Promise<void>
createChannel(id, type) Beta IChannel
createDeltaConnection() Beta MockDeltaConnection
dispose() Beta void
getAttachGCData(telemetryContext) Beta IGarbageCollectionData
getAttachSnapshot() Beta ITreeEntry[]
getAttachSummary() Beta ISummaryTreeWithStats
getAudience() Beta IAudience
getBlob(blobId) Beta Promise<any>
getChannel(id) Beta Promise<IChannel>
getGCData() Beta Promise<IGarbageCollectionData>
getQuorum() Beta IQuorumClients
makeVisibleAndAttachGraph() Beta void
notifyReadOnlyState(readonly) Beta void
processMessages(messageCollection) Beta void
processSignal(message, local) Beta void
request(request) Beta Promise<IResponse>
requestDataStore(request) Beta Promise<IResponse>
resolveHandle(request) Beta Promise<IResponse>
reSubmit(content, localOpMetadata, squash) Beta void
rollback(message, localOpMetadata) Beta optional void
save(message) Beta void
setAttachState(attachState) Beta void
setConnectionState(connected, clientId) Beta void
submitMessage(type, content) Beta null
submitSignal(type, content) Beta null
summarize(fullTree, trackState) Beta Promise<ISummaryTreeWithStats>
updateMinSequenceNumber(value) Beta void
updateUsedRoutes(usedRoutes) Beta void
uploadBlob(blob) Beta Promise<IFluidHandle<ArrayBufferLike>>
waitAttached() Beta Promise<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 & IIdCompressorCore;
attachState?: AttachState;
registry?: readonly IChannelFactory[];
});

Parameters

Parameter Modifiers Type Description
overrides optional { clientId?: string; entryPoint?: IFluidHandle<FluidObject>; id?: string; logger?: ITelemetryBaseLogger; idCompressor?: IIdCompressor & IIdCompressorCore; attachState?: AttachState; registry?: readonly IChannelFactory[]; }

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 & IIdCompressorCore) | undefined;

Type: (IIdCompressor & IIdCompressorCore) | 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.

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

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

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

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

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

Parameter Type Description
channel IChannel

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

Parameter Type Description
content any

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

Parameter Type Description
handle IFluidHandle

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

Parameter Type Description
channel IChannel

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

Parameter Type Description
id string | undefined
type string

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

Parameter Modifiers Type Description
telemetryContext optional ITelemetryContext | 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

Parameter Type Description
blobId string

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

Parameter Type Description
id string

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

Parameter Type Description
readonly boolean

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

Parameter Type Description
messageCollection IRuntimeMessageCollection

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

Parameter Type Description
message any
local boolean

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

Parameter Type Description
request IRequest

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

Parameter Type Description
request IRequest

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

Parameter Type Description
request IRequest

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

Parameter Modifiers Type Description
content any
localOpMetadata unknown
squash optional boolean

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

Parameter Type Description
message any
localOpMetadata unknown

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

Parameter Type Description
message string

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

Parameter Type Description
attachState AttachState.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

Parameter Modifiers Type Description
connected boolean
clientId optional string

submitMessage

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
submitMessage(type: MessageType, content: any): null;

Parameters

Parameter Type Description
type MessageType
content any

Returns

Return type: null

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(type: string, content: any): null;

Parameters

Parameter Type Description
type string
content any

Returns

Return type: null

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

Parameter Modifiers Type Description
fullTree optional boolean
trackState optional boolean

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

Parameter Type Description
value number

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

Parameter Type Description
usedRoutes string[]

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

Parameter Type Description
blob ArrayBufferLike

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>