support

package
v0.2.2 Latest Latest
Warning

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

Go to latest
Published: Apr 19, 2026 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Overview

Package support provides shared test context and utilities for integration tests.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type TestContext

type TestContext struct {
	BaseURL string
	Client  *http.Client

	// Auth state
	Token string

	// Resource IDs
	InstallationID string
	SourceID       string

	// Last response for assertions
	LastStatusCode int
	LastBody       []byte
}

TestContext holds state shared across scenario steps.

func NewTestContext

func NewTestContext() *TestContext

NewTestContext creates a new test context.

func (*TestContext) ParseResponse

func (c *TestContext) ParseResponse(v any) error

ParseResponse unmarshals the last response body into v.

func (*TestContext) Request

func (c *TestContext) Request(method, path string, body any) error

Request makes an HTTP request to the API.

func (*TestContext) Reset

func (c *TestContext) Reset()

Reset clears state between scenarios.

func (*TestContext) WaitFor

func (c *TestContext) WaitFor(timeout time.Duration, interval time.Duration, condition func() (bool, error)) error

WaitFor polls a condition until it returns true or timeout.

Jump to

Keyboard shortcuts

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