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

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

Properties

PropertyTypeDescription
createFluidEntryPoint(testContainerConfig?: ITestContainerConfig) => fluidEntryPoint
defaultCodeDetailsIFluidCodeDetails
documentIdstring
documentServiceFactoryIDocumentServiceFactory
driverITestDriver
LoaderConstructortypeof Loader
loggerEventAndErrorTrackingLogger
opProcessingControllerIOpProcessingController
urlResolverIUrlResolver

Methods

MethodReturn TypeDescription
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)LoaderMake 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

ParameterTypeDescription
LoaderConstructortypeof Loader
driverITestDriver
createFluidEntryPoint(testContainerConfig?: ITestContainerConfig) => fluidEntryPointcallback 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

ParameterModifiersTypeDescription
entryPointfluidEntryPoint
loaderPropsoptionalPartial<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

ParameterModifiersTypeDescription
packageEntriesIterable<[IFluidCodeDetails, fluidEntryPoint]>list of code details and fluidEntryPoint pairs.
loaderPropsoptionalPartial<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

ParameterModifiersTypeDescription
entryPointfluidEntryPoint
loaderPropsoptionalPartial<ILoaderProps>
requestHeaderoptionalIRequestHeader

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

ParameterModifiersTypeDescription
testContainerConfigoptionalITestContainerConfigoptional configuring the test Container
requestHeaderoptionalIRequestHeaderoptional 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

ParameterModifiersTypeDescription
testContainerConfigoptionalITestContainerConfigoptional 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

ParameterModifiersTypeDescription
testContainerConfigoptionalITestContainerConfigoptional configuring the test Container

Returns

Return type: Loader

reset

Signature

reset(): void;

resetLoaderContainerTracker

Signature

resetLoaderContainerTracker(syncSummarizerClients?: boolean): void;

Parameters

ParameterModifiersTypeDescription
syncSummarizerClientsoptionalboolean

updateDocumentId

Signature

updateDocumentId(resolvedUrl: IResolvedUrl | undefined): void;

Parameters

ParameterTypeDescription
resolvedUrlIResolvedUrl | undefined

waitContainerToCatchUp

Signature

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

Parameters

ParameterTypeDescription
containerIContainer

Returns

Return type: Promise<boolean>