k6test

package
v0.8.0 Latest Latest
Warning

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

Go to latest
Published: Jan 31, 2023 License: AGPL-3.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type VU

type VU struct {
	*k6modulestest.VU
	Loop *k6eventloop.EventLoop
	// contains filtered or unexported fields
}

VU is a k6 VU instance. TODO: Do we still need this VU wrapper? ToGojaValue can be a helper function that takes a goja.Runtime (although it's not much of a helper from calling ToValue(i) directly...), and we can access EventLoop from modulestest.Runtime.EventLoop.

func NewVU

func NewVU(tb testing.TB) *VU

NewVU returns a mock k6 VU.

func (*VU) AssertSamples added in v0.6.0

func (v *VU) AssertSamples(assertSample func(s k6metrics.Sample)) int

AssertSamples asserts each sample VU received since AssertSamples is last called, then it returns the number of received samples.

func (*VU) MoveToVUContext added in v0.5.0

func (v *VU) MoveToVUContext()

MoveToVUContext moves the VU to VU context, adding a predefined k6 lib State and nilling the InitEnv to simulate how that is done in the real k6.

func (*VU) ToGojaValue

func (v *VU) ToGojaValue(i any) goja.Value

ToGojaValue is a convenience method for converting any value to a goja value.

Jump to

Keyboard shortcuts

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