Skip to main content

PreprodTestEnvironment

For the complete documentation index, see llms.txt

@midnight-ntwrk/testkit-js v4.0.4


Test environment configuration for the Midnight preprod network. Provides URLs and endpoints for preprod network services.

Extends​

Constructors​

Constructor​

new PreprodTestEnvironment(logger): PreprodTestEnvironment

Creates a new TestEnvironment instance.

Parameters​

logger​

Logger

Logger instance for recording operations

Returns​

PreprodTestEnvironment

Inherited from​

RemoteTestEnvironment.constructor

Methods​

getEnvironmentConfiguration()​

getEnvironmentConfiguration(): EnvironmentConfiguration

Returns the configuration for the preprod environment services.

Returns​

EnvironmentConfiguration

Object containing URLs for preprod services:

  • indexer: GraphQL API endpoint for the indexer
  • indexerWS: WebSocket endpoint for the indexer
  • node: RPC endpoint for the blockchain node
  • faucet: API endpoint for requesting test tokens
  • proofServer: URL for the proof generation server

Overrides​

RemoteTestEnvironment.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​

RemoteTestEnvironment.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.

Inherited from​

RemoteTestEnvironment.healthCheck


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>

Inherited from​

RemoteTestEnvironment.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

Inherited from​

RemoteTestEnvironment.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

Inherited from​

RemoteTestEnvironment.startMidnightWalletProviders