Skip to main content
Version: v1

@fluidframework/test-runtime-utils Package

Interfaces

InterfaceDescription
IMockContainerRuntimePendingMessage

Classes

ClassDescription
InsecureTokenProvider

Provides an in memory implementation of ITokenProvider that can be used to insecurely connect to the Fluid Relay.

As the name implies, this is not secure and should not be used in production. It simply makes examples where authentication is not relevant easier to bootstrap.

MockContainerRuntimeMock implementation of ContainerRuntime for testing basic submitting and processing of messages. If test specific logic is required, extend this class and add the logic there. For an example, take a look at MockContainerRuntimeForReconnection.
MockContainerRuntimeFactoryFactory to create MockContainerRuntime for testing basic submitting and processing of messages. This also acts as a very basic server that stores the messages from all the MockContainerRuntimes and processes them when asked. If test specific logic is required, extend this class and add the logic there. For an example, take a look at MockContainerRuntimeFactoryForReconnection.
MockContainerRuntimeFactoryForReconnectionSpecalized implementation of MockContainerRuntimeFactory for testing ops during reconnection.
MockContainerRuntimeForReconnectionSpecalized implementation of MockContainerRuntime for testing ops during reconnection.
MockDeltaConnectionMock implementation of IDeltaConnection for testing
MockDeltaManagerMock implementation of IDeltaManager for testing that creates mock DeltaQueues for testing
MockDeltaQueueMock implementation of IDeltaQueue for testing that does nothing
MockEmptyDeltaConnectionMock implementation of IDeltaConnection
MockFluidDataStoreContext
MockFluidDataStoreRuntimeMock implementation of IRuntime for testing that does nothing
MockHandleMock implementation of IFluidHandle.
MockObjectStorageServiceMock implementation of IChannelStorageService
MockQuorumClients
MockSharedObjectServicesMock implementation of IChannelServices
MockStorageMock implementation of IChannelStorageService based on ITree input.

Functions

FunctionReturn TypeDescription
validateAssertionError(error, expectedErrorMsg)booleanValidates that an error thrown by our assert() function has the expected message, or a short code that corresponds to that message.

Function Details

validateAssertionError

Validates that an error thrown by our assert() function has the expected message, or a short code that corresponds to that message.

Signature

export declare function validateAssertionError(error: Error, expectedErrorMsg: string): boolean;

Remarks

The main use case for this is so tests that expect specific assert() calls to fail can always do comparisons based on the original string message, and work whether they run before the policy-check tool replaces those strings with short codes, or after. Note that it either returns true or throws an error (the behavior expected by NodeJS' assert.throws()).

Parameters

ParameterTypeDescription
errorErrorThe error object thrown by our assert() function. Its message property could be a short code, or the original string message coded into the asert().
expectedErrorMsgstring

Returns

  • true if the message in the error object that was passed in matches the expected message. Otherwise it throws an error.

Return type: boolean