webui

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Dec 17, 2025 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Run

func Run(ctx context.Context, reporter *SSEReporter, opts ...Option) error

Types

type File

type File struct {
	Name string `json:"name"`

	SubTests []*Test       `json:"subTests"`
	Infos    []*TestInfo   `json:"infos"`
	Duration time.Duration `json:"duration"`
	// contains filtered or unexported fields
}

func (*File) AddInfo

func (f *File) AddInfo(info reporter.Info)

func (*File) AddTest

func (f *File) AddTest(name, runner string) *Test

func (*File) End

func (f *File) End()

func (*File) Start

func (f *File) Start()

type Option

type Option func(*options)

func WithRoot

func WithRoot(root fs.FS) Option

type RerunRequest

type RerunRequest struct {
	Filename string
}

RerunRequest represents a request to rerun a test file

type SSEMessage

type SSEMessage struct {
	Type string `json:"type"`
	Data any    `json:"data"`
}

type SSEReporter

type SSEReporter struct {
	// contains filtered or unexported fields
}

func NewSSEReporter

func NewSSEReporter(dir string) *SSEReporter

func (*SSEReporter) Info

func (r *SSEReporter) Info(info reporter.Info)

func (*SSEReporter) RemoveFile

func (r *SSEReporter) RemoveFile(name string)

func (*SSEReporter) ReportError

func (r *SSEReporter) ReportError(err *reporter.Error)

func (*SSEReporter) RequestRerun

func (r *SSEReporter) RequestRerun(filename string)

RequestRerun sends a rerun request for the given filename

func (*SSEReporter) RerunChannel

func (r *SSEReporter) RerunChannel() <-chan RerunRequest

RerunChannel returns the channel for rerun requests

func (*SSEReporter) RunFile

func (r *SSEReporter) RunFile(ctx context.Context, filename string, fn func(reporter.Reporter))

func (*SSEReporter) RunTest

func (r *SSEReporter) RunTest(ctx context.Context, runner, name string, fn func(reporter.Reporter))

type Test

type Test struct {
	Filename string `json:"filename"`
	Name     string `json:"name"`
	Runner   string `json:"runner"`
	Order    int    `json:"order"`

	Errors   []*TestError  `json:"errors"`
	Infos    []*TestInfo   `json:"infos"`
	Duration time.Duration `json:"duration"`
	// contains filtered or unexported fields
}

func (*Test) AddError

func (t *Test) AddError(err *reporter.Error)

func (*Test) AddInfo

func (t *Test) AddInfo(info reporter.Info)

func (*Test) End

func (t *Test) End()

func (*Test) Start

func (t *Test) Start()

type TestError

type TestError struct {
	Message  string `json:"message"`
	Expected any    `json:"expected,omitempty"`
	Actual   any    `json:"actual,omitempty"`
}

type TestInfo

type TestInfo struct {
	Type      reporter.InfoType  `json:"type"`
	Title     string             `json:"title"`
	Content   string             `json:"content"`
	Args      []reporter.InfoArg `json:"args,omitempty"`
	Timestamp time.Duration      `json:"timestamp"`
	Order     int                `json:"order"`
	Langauge  string             `json:"language,omitempty"`
}

Jump to

Keyboard shortcuts

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