@fluidframework/test-utils Package
Packages > @fluidframework/test-utils
Classes
Class | Description |
---|---|
LocalCodeLoader | A simple code loader that caches a mapping of package name to a Fluid entry point. On load, it retrieves the entry point matching the package name in the given code details. |
OpProcessingController | Class with access to the local delta connection server and delta managers that can control op processing. |
TestContainerRuntimeFactory | A container runtime factory that allows you to set runtime options |
TestFluidObject | A test Fluid object that will create a shared object for each key-value pair in the factoryEntries passed to load. The shared objects can be retrieved by passing the key of the entry to getSharedObject. It exposes the IFluidDataStoreContext and IFluidDataStoreRuntime. |
TestFluidObjectFactory | Creates a factory for a TestFluidObject with the given object factory entries. It creates a data store runtime with the object factories in the entry list. All the entries with an id other than undefined are passed to the Fluid object so that it can create a shared object for each.For example, the following will create a Fluid object that creates and loads a SharedString and SharedDirectory. It will add SparseMatrix to the data store's factory so that it can be created later. new TestFluidObjectFactory([ [ "sharedString", SharedString.getFactory() ], [ "sharedDirectory", SharedDirectory.getFactory() ], [ undefined, SparseMatrix.getFactory() ], ]);The SharedString and SharedDirectory can be retrieved via getSharedObject() on the TestFluidObject as follows: sharedString = testFluidObject.getSharedObject |
TestObjectProvider | Shared base class for test object provider. Contain code for loader and container creation and loading |
Functions
Function | Description |
---|---|
createAndAttachContainer(source, loader, attachRequest) | Creates a detached Container and attaches it. |
createLocalLoader(packageEntries, deltaConnectionServer, urlResolver, options) | Creates a loader with the given package entries and a delta connection server. |
timeoutPromise(executor, timeoutOptions) |
Interfaces
Interface | Description |
---|---|
IDeltaConnectionServerMonitor | |
IProvideTestFluidObject | |
ITestFluidObject | |
TimeoutWithError | |
TimeoutWithValue |
Variables
Variable | Description |
---|---|
defaultTimeoutDurationMs |
Type Aliases
Type Alias | Description |
---|---|
ChannelFactoryRegistry | |
DeltaManager | |
fluidEntryPoint | |
SupportedExportInterfaces |
Functions
createAndAttachContainer
Creates a detached Container and attaches it.
Signature:
export declare function createAndAttachContainer(source: IFluidCodeDetails, loader: ILoader, attachRequest: IRequest): Promise<IContainer>;
Parameters
Parameter | Type | Description |
---|---|---|
source | IFluidCodeDetails | The code details used to create the Container. |
loader | ILoader | The loader to use to initialize the container. |
attachRequest | IRequest | The request to create new from. |
Returns:
Promise<IContainer>
createLocalLoader
Creates a loader with the given package entries and a delta connection server.
Signature:
export declare function createLocalLoader(packageEntries: Iterable<[IFluidCodeDetails, fluidEntryPoint]>, deltaConnectionServer: ILocalDeltaConnectionServer, urlResolver: IUrlResolver, options?: ILoaderOptions): ILoader;
Parameters
Parameter | Type | Description |
---|---|---|
packageEntries | Iterable<[IFluidCodeDetails, fluidEntryPoint]> | A list of code details to Fluid entry points. |
deltaConnectionServer | ILocalDeltaConnectionServer | The delta connection server to use as the server. |
urlResolver | IUrlResolver | |
options | ILoaderOptions |
Returns:
timeoutPromise
Signature:
export declare function timeoutPromise<T = void>(executor: (resolve: (value: T | PromiseLike<T>) => void, reject: (reason?: any) => void) => void, timeoutOptions?: TimeoutWithError | TimeoutWithValue<T>): Promise<T | void>;
Parameters
Parameter | Type | Description |
---|---|---|
executor | (resolve: (value: T | PromiseLike |
|
timeoutOptions | TimeoutWithError | TimeoutWithValue |
Returns:
Promise<T | void>
Variables
defaultTimeoutDurationMs
Signature:
defaultTimeoutDurationMs = 250
Type Aliases
ChannelFactoryRegistry
Signature:
export declare type ChannelFactoryRegistry = Iterable<[string | undefined, IChannelFactory]>;
DeltaManager
Signature:
export declare type DeltaManager = IDeltaManager<ISequencedDocumentMessage, IDocumentMessage>;
fluidEntryPoint
Signature:
export declare type fluidEntryPoint = SupportedExportInterfaces | IFluidModule;
SupportedExportInterfaces
Signature:
export declare type SupportedExportInterfaces = Partial<IProvideRuntimeFactory & IProvideFluidDataStoreFactory & IProvideFluidDataStoreRegistry & IProvideFluidCodeDetailsComparer>;