e2e

package
v1.2.5 Latest Latest
Warning

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

Go to latest
Published: Jan 12, 2026 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ServerBlockWithConfig added in v1.2.0

func ServerBlockWithConfig(cfg SubstrateConfig) string

ServerBlockWithConfig returns a server block with the specified substrate configuration.

func StandardServerBlock added in v1.2.0

func StandardServerBlock() string

StandardServerBlock returns the default server block for substrate tests. It matches *.js files and routes them through the substrate transport.

Types

type E2ETestContext

type E2ETestContext struct {
	T                *testing.T
	TempDir          string
	Tester           *caddytest.Tester
	BaseURL          string
	HTTPPort         int
	ExpectedResponse string
}

func RunE2ETest

func RunE2ETest(t *testing.T, serverBlockContent string, files []TestFile) *E2ETestContext

func (*E2ETestContext) AssertGet

func (ctx *E2ETestContext) AssertGet(path, expectedBody string)

func (*E2ETestContext) AssertGetStatus

func (ctx *E2ETestContext) AssertGetStatus(path string, expectedStatus int)

func (*E2ETestContext) GetBody added in v1.2.0

func (ctx *E2ETestContext) GetBody(path string) (string, int)

GetBody performs a GET request and returns the response body and status code. Useful for tests that need to do complex assertions on response content.

type SubstrateConfig added in v1.2.0

type SubstrateConfig struct {
	IdleTimeout    string // e.g., "5m", "0", "-1"
	StartupTimeout string // e.g., "30s"
}

SubstrateConfig holds optional configuration for the substrate transport.

type TestFile

type TestFile struct {
	Path    string
	Content string
	Mode    os.FileMode // Optional, 0 defaults to 0644
}

Jump to

Keyboard shortcuts

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