TestObjectProvider Class

Packages > @fluidframework/test-utils > TestObjectProvider

Shared base class for test object provider. Contain code for loader and container creation and loading

Signature:

export declare class TestObjectProvider 

Constructors

List of constructors for this class
Constructor Modifiers Description
(constructor)(LoaderConstructor, driver, createFluidEntryPoint) Manage objects for loading and creating container, including the driver, loader, and OpProcessingController

Properties

List of properties for this class
Property Modifiers Type Description
defaultCodeDetails IFluidCodeDetails
documentId string
documentServiceFactory IDocumentServiceFactory
driver ITestDriver
LoaderConstructor typeof Loader
opProcessingController IOpProcessingController
urlResolver IUrlResolver

Methods

List of methods on this class
Method Modifiers Description
createContainer(entryPoint, options) Create a container using a default document id and code details. Container created is automatically added to the OpProcessingController to manage op flowOnly the version of the loader will vary based on compat config. The version of containerRuntime/dataRuntime used in fluidEntryPoint will be used as is from what is passed in.
createLoader(packageEntries, options) Create a loader. Container created/loaded thru this loader will not be automatically added to the OpProcessingController, and will need to be added manually if needed.Only the version of the loader will vary based on compat config. The version of containerRuntime/dataRuntime used in fluidEntryPoint will be used as is from what is passed in.
ensureSynchronized()
loadContainer(entryPoint, options, requestHeader)
loadTestContainer(testContainerConfig) Load a container using a default document id and code details. Container loaded is automatically added to the OpProcessingController to manage op flow
makeTestContainer(testContainerConfig) Make a container using a default document id and code details Container loaded is automatically added to the OpProcessingController to manage op flow
makeTestLoader(testContainerConfig) Make a test loader. Container created/loaded thru this loader will not be automatically added to the OpProcessingController, and will need to be added manually if needed. The version of the loader/containerRuntime/dataRuntime may vary based on compat config of the current run
reset()

Constructors

TestObjectProvider.(constructor)

Manage objects for loading and creating container, including the driver, loader, and OpProcessingController

Signature:

constructor(LoaderConstructor: typeof Loader, driver: ITestDriver, createFluidEntryPoint: (testContainerConfig?: ITestContainerConfig) => fluidEntryPoint);

Parameters

List of parameters
Parameter Type Description
LoaderConstructor typeof Loader
driver ITestDriver
createFluidEntryPoint (testContainerConfig?: ITestContainerConfig) => fluidEntryPoint callback to create a fluidEntryPoint, with an optiona; set of channel name and factory for TestFluidObject

Properties

defaultCodeDetails

Signature:

get defaultCodeDetails(): IFluidCodeDetails;

documentId

Signature:

get documentId(): string;

documentServiceFactory

Signature:

get documentServiceFactory(): IDocumentServiceFactory;

driver

Signature:

readonly driver: ITestDriver;

LoaderConstructor

Signature:

readonly LoaderConstructor: typeof Loader;

opProcessingController

Signature:

get opProcessingController(): IOpProcessingController;

urlResolver

Signature:

get urlResolver(): IUrlResolver;

Methods

createContainer

Create a container using a default document id and code details. Container created is automatically added to the OpProcessingController to manage op flow

Only the version of the loader will vary based on compat config. The version of containerRuntime/dataRuntime used in fluidEntryPoint will be used as is from what is passed in.

Signature:

createContainer(entryPoint: fluidEntryPoint, options?: ILoaderOptions): Promise<IContainer>;

Parameters

List of parameters
Parameter Type Description
entryPoint fluidEntryPoint
options ILoaderOptions

Returns:

Promise<IContainer>

createLoader

Create a loader. Container created/loaded thru this loader will not be automatically added to the OpProcessingController, and will need to be added manually if needed.

Only the version of the loader will vary based on compat config. The version of containerRuntime/dataRuntime used in fluidEntryPoint will be used as is from what is passed in.

Signature:

createLoader(packageEntries: Iterable<[IFluidCodeDetails, fluidEntryPoint]>, options?: ILoaderOptions): Loader;

Parameters

List of parameters
Parameter Type Description
packageEntries Iterable<[IFluidCodeDetails, fluidEntryPoint]> list of code details and fluidEntryPoint pairs.
options ILoaderOptions

Returns:

Loader

ensureSynchronized

Signature:

ensureSynchronized(): Promise<void>;

Returns:

Promise<void>

loadContainer

Signature:

loadContainer(entryPoint: fluidEntryPoint, options?: ILoaderOptions, requestHeader?: IRequestHeader): Promise<Container>;

Parameters

List of parameters
Parameter Type Description
entryPoint fluidEntryPoint
options ILoaderOptions
requestHeader IRequestHeader

Returns:

Promise<Container>

loadTestContainer

Load a container using a default document id and code details. Container loaded is automatically added to the OpProcessingController to manage op flow

Signature:

loadTestContainer(testContainerConfig?: ITestContainerConfig): Promise<Container>;

Parameters

List of parameters
Parameter Type Description
testContainerConfig ITestContainerConfig optional configuring the test Container

Returns:

Promise<Container>

makeTestContainer

Make a container using a default document id and code details Container loaded is automatically added to the OpProcessingController to manage op flow

Signature:

makeTestContainer(testContainerConfig?: ITestContainerConfig): Promise<IContainer>;

Parameters

List of parameters
Parameter Type Description
testContainerConfig ITestContainerConfig optional configuring the test Container

Returns:

Promise<IContainer>

makeTestLoader

Make a test loader. Container created/loaded thru this loader will not be automatically added to the OpProcessingController, and will need to be added manually if needed. The version of the loader/containerRuntime/dataRuntime may vary based on compat config of the current run

Signature:

makeTestLoader(testContainerConfig?: ITestContainerConfig): Loader;

Parameters

List of parameters
Parameter Type Description
testContainerConfig ITestContainerConfig optional configuring the test Container

Returns:

Loader

reset

Signature:

reset(): void;

Returns:

void