Skip to main content
Version: v1

MockStorage Class

Mock implementation of IChannelStorageService based on ITree input.

Signature​

export declare class MockStorage implements IChannelStorageService

Implements: IChannelStorageService

Constructors​

ConstructorDescription
(constructor)(tree)Constructs a new instance of the MockStorage class

Static Methods​

MethodReturn TypeDescription
createFromSummary(summaryTree)MockStorage

Properties​

PropertyModifiersTypeDescription
treeoptionalITree | undefined

Methods​

MethodReturn TypeDescription
contains(path)Promise<boolean>
list(path)Promise<string[]>
readBlob(path)Promise<ArrayBufferLike>

Constructor Details​

(constructor)​

Constructs a new instance of the MockStorage class

Signature​

constructor(tree?: ITree | undefined);

Parameters​

ParameterModifiersTypeDescription
treeoptionalITree | undefined

Property Details​

tree​

Signature​

protected tree?: ITree | undefined;

Type: ITree | undefined

Method Details​

contains​

Signature​

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

Parameters​

ParameterTypeDescription
pathstring

Returns​

Return type: Promise<boolean>

createFromSummary​

Signature​

static createFromSummary(summaryTree: ISummaryTree): MockStorage;

Parameters​

ParameterTypeDescription
summaryTreeISummaryTree

Returns​

Return type: MockStorage

list​

Signature​

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

Parameters​

ParameterTypeDescription
pathstring

Returns​

Return type: Promise<string[]>

readBlob​

Signature​

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

Parameters​

ParameterTypeDescription
pathstring

Returns​

Return type: Promise<ArrayBufferLike>