Skip to main content

RemoteTestEnvironment

For the complete documentation index, see llms.txt

@midnight-ntwrk/testkit-js v4.0.4


Base class for remote test environments that connect to external network services. Provides functionality for managing walletProviders and a proof server container.

Extends​

Extended by​

Constructors​

Constructor​

new RemoteTestEnvironment(logger): RemoteTestEnvironment

Creates a new TestEnvironment instance.

Parameters​

logger​

Logger

Logger instance for recording operations

Returns​

RemoteTestEnvironment

Inherited from​

TestEnvironment.constructor

Methods​

getEnvironmentConfiguration()​

abstract getEnvironmentConfiguration(): EnvironmentConfiguration

Abstract method that must be implemented by subclasses to provide environment configuration.

Returns​

EnvironmentConfiguration

Configuration object containing service URLs and endpoints

Overrides​

TestEnvironment.getEnvironmentConfiguration


getMidnightWalletProvider()​

getMidnightWalletProvider(): Promise<MidnightWalletProvider>

Starts a single wallet instance.

Returns​

Promise<MidnightWalletProvider>

A promise that resolves to the started wallet

Throws​

If no wallet could be started

Inherited from​

TestEnvironment.getMidnightWalletProvider


healthCheck()​

healthCheck(): Promise<void>

Performs a health check for the environment. Checks the health of the node, indexer, and optionally the faucet services.

Returns​

Promise<void>

A promise that resolves when the health check is complete.


shutdown()​

shutdown(saveWalletState?): Promise<void>

Shuts down the test environment by closing all walletProviders and stopping the proof server.

Parameters​

saveWalletState?​

boolean

Returns​

Promise<void>

Overrides​

TestEnvironment.shutdown


start()​

start(maybeProofServerContainer?): Promise<EnvironmentConfiguration>

Starts the test environment by initializing the proof server and environment configuration.

Parameters​

maybeProofServerContainer?​

ProofServerContainer

Optional proof server container to use instead of creating a new one

Returns​

Promise<EnvironmentConfiguration>

The environment configuration

Overrides​

TestEnvironment.start


startMidnightWalletProviders()​

startMidnightWalletProviders(amount?, seeds?): Promise<MidnightWalletProvider[]>

Creates and starts the specified number of wallet providers.

Parameters​

amount?​

number = 1

seeds?​

string[] | undefined

Returns​

Promise<MidnightWalletProvider[]>

Array of started wallet providers

Overrides​

TestEnvironment.startMidnightWalletProviders