Skip to main content

MockObjectStorageService Class

Mock implementation of IChannelStorageService

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

Implements: IChannelStorageService

Constructors​

ConstructorAlertsDescription
(constructor)(contents)BetaConstructs a new instance of the MockObjectStorageService class

Methods​

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

Constructor Details​

(constructor)​

Constructs a new instance of the MockObjectStorageService 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(contents: {
[key: string]: string;
});

Remarks​

The snapshot contents must not change after it has been passed here as the changes will not be reflected in the snapshot tree retrieved via getSnapshotTree.

Parameters​

ParameterTypeDescription
contents{ [key: string]: string; }Key value pairs that represent a snapshot. The keys are the path to the contents of a blob in the snapshot tree. The corresponding values are its contents.

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>

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;

Returns​

Return type: ISnapshotTree

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>