Skip to main content
Version: v1

TestObjectProvider Class

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

Signature

export declare class TestObjectProvider implements ITestObjectProvider

Implements: ITestObjectProvider

Constructors

Constructor Description
(constructor)(LoaderConstructor, driver, createFluidEntryPoint) Manage objects for loading and creating container, including the driver, loader, and OpProcessingController

Properties

Property Type Description
createFluidEntryPoint (testContainerConfig?: ITestContainerConfig) => fluidEntryPoint
defaultCodeDetails IFluidCodeDetails
documentId string
documentServiceFactory IDocumentServiceFactory
driver ITestDriver
LoaderConstructor typeof Loader
logger EventAndErrorTrackingLogger
opProcessingController IOpProcessingController
urlResolver IUrlResolver

Methods

Method Return Type Description
createContainer(entryPoint, loaderProps) Promise<IContainer>

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.

createLoader(packageEntries, loaderProps) Loader

Create a loader. Containers created/loaded through this loader will be added to the OpProcessingController.

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() Promise<void>
loadContainer(entryPoint, loaderProps, requestHeader) Promise<IContainer>
loadTestContainer(testContainerConfig, requestHeader) Promise<IContainer> Load a container using a default document id and code details. IContainer loaded is automatically added to the OpProcessingController to manage op flow
makeTestContainer(testContainerConfig) Promise<IContainer> 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) Loader Make a test loader. Containers created/loaded through this loader will be added to the OpProcessingController. The version of the loader/containerRuntime/dataRuntime may vary based on compat config of the current run
reset() void
resetLoaderContainerTracker(syncSummarizerClients) void
updateDocumentId(resolvedUrl) void
waitContainerToCatchUp(container) Promise<boolean>

Constructor Details

(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

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

Property Details

createFluidEntryPoint

Signature

readonly createFluidEntryPoint: (testContainerConfig?: ITestContainerConfig) => fluidEntryPoint;

Type: (testContainerConfig?: ITestContainerConfig) => fluidEntryPoint

defaultCodeDetails

Signature

get defaultCodeDetails(): IFluidCodeDetails;

Type: IFluidCodeDetails

documentId

Signature

get documentId(): string;

Type: string

documentServiceFactory

Signature

get documentServiceFactory(): IDocumentServiceFactory;

Type: IDocumentServiceFactory

driver

Signature

readonly driver: ITestDriver;

Type: ITestDriver

LoaderConstructor

Signature

readonly LoaderConstructor: typeof Loader;

Type: typeof Loader

logger

Signature

get logger(): EventAndErrorTrackingLogger;

Type: EventAndErrorTrackingLogger

opProcessingController

Signature

get opProcessingController(): IOpProcessingController;

Type: IOpProcessingController

urlResolver

Signature

get urlResolver(): IUrlResolver;

Type: IUrlResolver

Method Details

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, loaderProps?: Partial<ILoaderProps>): Promise<IContainer>;

Parameters

Parameter Modifiers Type Description
entryPoint fluidEntryPoint
loaderProps optional Partial<ILoaderProps>

Returns

Return type: Promise<IContainer>

createLoader

Create a loader. Containers created/loaded through this loader will be added to the OpProcessingController.

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]>, loaderProps?: Partial<ILoaderProps>): Loader;

Parameters

Parameter Modifiers Type Description
packageEntries Iterable<[IFluidCodeDetails, fluidEntryPoint]> list of code details and fluidEntryPoint pairs.
loaderProps optional Partial<ILoaderProps>

Returns

Return type: Loader

ensureSynchronized

Signature

ensureSynchronized(): Promise<void>;

Returns

Return type: Promise<void>

loadContainer

Signature

loadContainer(entryPoint: fluidEntryPoint, loaderProps?: Partial<ILoaderProps>, requestHeader?: IRequestHeader): Promise<IContainer>;

Parameters

Parameter Modifiers Type Description
entryPoint fluidEntryPoint
loaderProps optional Partial<ILoaderProps>
requestHeader optional IRequestHeader

Returns

Return type: Promise<IContainer>

loadTestContainer

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

Signature

loadTestContainer(testContainerConfig?: ITestContainerConfig, requestHeader?: IRequestHeader): Promise<IContainer>;

Parameters

Parameter Modifiers Type Description
testContainerConfig optional ITestContainerConfig optional configuring the test Container
requestHeader optional IRequestHeader optional headers to be supplied to the loader

Returns

Return type: Promise<IContainer>

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

Parameter Modifiers Type Description
testContainerConfig optional ITestContainerConfig optional configuring the test Container

Returns

Return type: Promise<IContainer>

makeTestLoader

Make a test loader. Containers created/loaded through this loader will be added to the OpProcessingController. The version of the loader/containerRuntime/dataRuntime may vary based on compat config of the current run

Signature

makeTestLoader(testContainerConfig?: ITestContainerConfig): Loader;

Parameters

Parameter Modifiers Type Description
testContainerConfig optional ITestContainerConfig optional configuring the test Container

Returns

Return type: Loader

reset

Signature

reset(): void;

resetLoaderContainerTracker

Signature

resetLoaderContainerTracker(syncSummarizerClients?: boolean): void;

Parameters

Parameter Modifiers Type Description
syncSummarizerClients optional boolean

updateDocumentId

Signature

updateDocumentId(resolvedUrl: IResolvedUrl | undefined): void;

Parameters

Parameter Type Description
resolvedUrl IResolvedUrl | undefined

waitContainerToCatchUp

Signature

waitContainerToCatchUp(container: IContainer): Promise<boolean>;

Parameters

Parameter Type Description
container IContainer

Returns

Return type: Promise<boolean>