testapp

package
v0.0.0-...-ae8e89f Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 27, 2024 License: Apache-2.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	TestConfigs = []TestConfig{
		{
			Namespace: "chainstorage",
			ConfigNames: []string{
				"aptos-mainnet",
				"arbitrum-mainnet",
				"avacchain-mainnet",
				"base-goerli",
				"base-mainnet",
				"bitcoin-mainnet",
				"bsc-mainnet",
				"dogecoin-mainnet",
				"ethereum-goerli",
				"ethereum-holesky",
				"ethereum-mainnet",
				"fantom-mainnet",
				"optimism-mainnet",
				"polygon-mainnet",
				"polygon-testnet",
				"solana-mainnet",
			},
		},
	}
)

Functions

func TestAllConfigs

func TestAllConfigs(t *testing.T, fn TestFn)

func TestAllEnvs

func TestAllEnvs(t *testing.T, fn TestFn)

func WithBlockchainNetwork

func WithBlockchainNetwork(blockchain common.Blockchain, network common.Network) fx.Option

WithBlockchainNetwork loads the config according to the specified blockchain and network.

func WithBlockchainNetworkSidechain

func WithBlockchainNetworkSidechain(blockchain common.Blockchain, network common.Network, sidechain api.SideChain) fx.Option

WithBlockchainNetworkSidechain loads the config according to the specified blockchain, network and sidechain.

func WithConfig

func WithConfig(cfg *config.Config) fx.Option

WithConfig overrides the default config.

func WithFunctional

func WithFunctional() fx.Option

WithFunctional runs the test only if $TEST_TYPE is functional.

func WithIntegration

func WithIntegration() fx.Option

WithIntegration runs the test only if $TEST_TYPE is integration.

Types

type TestApp

type TestApp interface {
	Close()
	Logger() *zap.Logger
	Config() *config.Config
}

func New

func New(t testing.TB, opts ...fx.Option) TestApp

func NewWithoutEndpoints

func NewWithoutEndpoints(t testing.TB, opts ...fx.Option) TestApp

type TestConfig

type TestConfig struct {
	Namespace   string
	ConfigNames []string
}

type TestFn

type TestFn func(t *testing.T, cfg *config.Config)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL