Skip to content 

@fluidframework/test-utils Package

Packages > @fluidframework/test-utils

Classes

List of classes contained in this package or namespace
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("sharedString"); sharedDir = testFluidObject.getSharedObject("sharedDirectory");

Functions

List of functions contained in this package or namespace
Function Description
createAndAttachContainer(documentId, source, loader, urlResolver) Creates a detached Container and attaches it.
createLocalLoader(packageEntries, deltaConnectionServer, urlResolver) Creates a loader with the given package entries and a delta connection server.

Interfaces

List of interfaces contained in this package or namespace
Interface Description
IProvideTestFluidObject
ITestFluidObject

Type Aliases

List of type aliases contained in this package or namespace
Type Alias Description
ChannelFactoryRegistry
DeltaManager
fluidEntryPoint

Functions

createAndAttachContainer

Creates a detached Container and attaches it.

Signature:

export declare function createAndAttachContainer(documentId: string, source: IFluidCodeDetails, loader: ILoader, urlResolver: IUrlResolver): Promise<IContainer>;

Parameters

List of parameters
Parameter Type Description
documentId string The documentId for the container.
source IFluidCodeDetails The code details used to create the Container.
loader ILoader The loader to use to initialize the container.
urlResolver IUrlResolver

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, Partial<IProvideRuntimeFactory & IProvideFluidDataStoreFactory & IFluidModule>]>, deltaConnectionServer: ILocalDeltaConnectionServer, urlResolver: IUrlResolver): ILoader;

Parameters

List of parameters
Parameter Type Description
packageEntries Iterable<[IFluidCodeDetails, Partial<IProvideRuntimeFactory & IProvideFluidDataStoreFactory & IFluidModule>]> A list of code details to Fluid entry points.
deltaConnectionServer ILocalDeltaConnectionServer The delta connection server to use as the server.
urlResolver IUrlResolver

Returns:

ILoader

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 = Partial<IProvideRuntimeFactory & IProvideFluidDataStoreFactory & IProvideFluidDataStoreRegistry & IFluidModule>;