RemoteTestEnvironment
Midnight.js API Reference v2.0.2
Midnight.js API Reference / @midnight-ntwrk/midnight-js-testing / RemoteTestEnvironment
Class: abstract RemoteTestEnvironment
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β
QanetTestEnvironmentDevnetTestEnvironmentTestnetTestEnvironmentTestnet2TestEnvironmentEnvVarRemoteTestEnvironment
Constructorsβ
Constructorβ
new RemoteTestEnvironment(
logger):RemoteTestEnvironment
Creates a new TestEnvironment instance.
Parametersβ
loggerβ
Logger
Logger instance for recording operations
Returnsβ
RemoteTestEnvironment
Inherited fromβ
Methodsβ
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β
start()β
start(
maybeProofServerContainer?):Promise<EnvironmentConfiguration>
Starts the test environment by initializing the proof server and environment configuration.
Parametersβ
maybeProofServerContainer?β
Optional proof server container to use instead of creating a new one
Returnsβ
Promise<EnvironmentConfiguration>
The environment configuration
Overridesβ
startMidnightWalletProviders()β
startMidnightWalletProviders(
amount,seeds):Promise<MidnightWalletProvider[]>
Creates and starts the specified number of wallet providers.
Parametersβ
amountβ
number = 1
seedsβ
undefined | string[]
Returnsβ
Promise<MidnightWalletProvider[]>
Array of started wallet providers