MockObjectStorageService Class
Mock implementation of IChannelStorageService \
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
| Constructor | Alerts | Description |
|---|---|---|
| (constructor)(contents) | Beta |
Constructs a new instance of the MockObjectStorageService class |
Methods
| Method | Alerts | Return Type | Description |
|---|---|---|---|
| contains(path) | Beta |
Promise<boolean> | |
| getSnapshotTree() | Beta |
ISnapshotTree | |
| list(path) | Beta |
Promise<string[]> | |
| readBlob(path) | Beta |
Promise<ArrayBufferLike> |
Constructor Details
(constructor)
Constructs a new instance of the MockObjectStorageService class
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
| Parameter | Type | Description |
|---|---|---|
| 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
For more information about our API support guarantees, see here.
Signature
contains(path: string): Promise<boolean>;
Parameters
| Parameter | Type | Description |
|---|---|---|
| path | string |
Returns
Return type: Promise<boolean>
getSnapshotTree
For more information about our API support guarantees, see here.
Signature
getSnapshotTree(): ISnapshotTree;
Returns
Return type: ISnapshotTree
list
For more information about our API support guarantees, see here.
Signature
list(path: string): Promise<string[]>;
Parameters
| Parameter | Type | Description |
|---|---|---|
| path | string |
Returns
Return type: Promise<string[]>
readBlob
For more information about our API support guarantees, see here.
Signature
readBlob(path: string): Promise<ArrayBufferLike>;
Parameters
| Parameter | Type | Description |
|---|---|---|
| path | string |
Returns
Return type: Promise<ArrayBufferLike>