webui

package
v0.1.0-pre.8 Latest Latest
Warning

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

Go to latest
Published: Nov 5, 2024 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"`
	Duration time.Duration `json:"duration"`
	// contains filtered or unexported fields
}

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 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) Error

func (r *SSEReporter) Error(msg string, args ...any)

func (*SSEReporter) RemoveFile

func (r *SSEReporter) RemoveFile(name string)

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"`

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

func (*Test) AddError

func (t *Test) AddError(msg string, args ...any)

func (*Test) End

func (t *Test) End()

func (*Test) Start

func (t *Test) Start()

type TestError

type TestError struct {
	Message string `json:"message"`
}

Jump to

Keyboard shortcuts

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