Skip to main content
Version: v2

MockStorage Class

Mock implementation of IChannelStorageService based on ITree input.

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 MockStorage implements IChannelStorageService

Implements: IChannelStorageService

Constructors​

ConstructorAlertsDescription
(constructor)(tree)BetaConstructs a new instance of the MockStorage class

Static Methods​

MethodAlertsReturn TypeDescription
createFromSummary(summaryTree)BetaMockStorage

Properties​

PropertyAlertsModifiersTypeDescription
treeBetaoptionalITree | undefined

Methods​

MethodAlertsReturn TypeDescription
contains(path)BetaPromise<boolean>
getSnapshotTree()BetaISnapshotTree | undefined
list(path)BetaPromise<string[]>
readBlob(path)BetaPromise<ArrayBufferLike>

Constructor Details​

(constructor)​

Constructs a new instance of the MockStorage 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(tree?: ITree | undefined);

Parameters​

ParameterModifiersTypeDescription
treeoptionalITree | undefined

Property Details​

tree​

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​

protected tree?: ITree | undefined;

Type: ITree | undefined

Method Details​

contains​

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​

contains(path: string): Promise<boolean>;

Parameters​

ParameterTypeDescription
pathstring

Returns​

Return type: Promise<boolean>

createFromSummary​

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​

static createFromSummary(summaryTree: ISummaryTree): MockStorage;

Parameters​

ParameterTypeDescription
summaryTreeISummaryTree

Returns​

Return type: MockStorage

getSnapshotTree​

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​

getSnapshotTree(): ISnapshotTree | undefined;

Returns​

Return type: ISnapshotTree | undefined

list​

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​

list(path: string): Promise<string[]>;

Parameters​

ParameterTypeDescription
pathstring

Returns​

Return type: Promise<string[]>

readBlob​

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​

readBlob(path: string): Promise<ArrayBufferLike>;

Parameters​

ParameterTypeDescription
pathstring

Returns​

Return type: Promise<ArrayBufferLike>