kerotest

package
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: Mar 31, 2024 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const DashPass = "pass"
View Source
const DashPath = "/_kero_test"
View Source
const DashUsername = "admin"
View Source
const HelloPath = "/hello/:id"
View Source
const PixelPath = "/px.gif"
View Source
const PrefixToIgnore = "/hello"
View Source
const WaitDuration = time.Duration(123 * time.Millisecond)
View Source
const WaitPath = "/wait"

Variables

View Source
var DashboardTests = []DashboardTest{
	{
		Description: "prevent unauthorized access",
		Path:        DashPath,
		Authed:      false,

		ExpectError: true,
	},
	{
		Description: "load CSS assets",
		Path:        DashPath + "/assets/css/app.css",
		Authed:      true,
		ExpectError: false,
	},
	{
		Description: "load dashboard with some content",
		Path:        DashPath,
		Authed:      true,
		ExpectError: false,
	},
}
View Source
var TrackingTests = []TrackingTest{
	{
		Path:              "/favicon.ico",
		ExpectToBeTracked: false,
	},
	{
		Path:              DashPath,
		ExpectToBeTracked: false,
	},
	{
		Path:              "/hello/world",
		ExpectToBeTracked: true,
	},
	{
		Path:              "/hello/earth",
		ExpectToBeTracked: true,
	},
	{
		Path:              "/hello/go",
		ExpectToBeTracked: true,
	},
	{
		Path:              "/",
		ExpectToBeTracked: true,
	},
}
View Source
var WaitRequest = httptest.NewRequest("GET", WaitPath, nil)

Functions

func ExpectDurationTracked

func ExpectDurationTracked(t *testing.T, k *kero.Kero)

func ExpectHelloIgnored added in v0.5.0

func ExpectHelloIgnored(t *testing.T, k *kero.Kero)

func ExpectPixelToTrack added in v0.2.0

func ExpectPixelToTrack(t *testing.T, k *kero.Kero)

func ExpectRequestsTracked

func ExpectRequestsTracked(t *testing.T, k *kero.Kero)

func IgnoredHelloRequest added in v0.5.0

func IgnoredHelloRequest() *http.Request

func PixelRequest added in v0.2.0

func PixelRequest() *http.Request

Types

type DashboardTest

type DashboardTest struct {
	Description string
	Path        string
	Authed      bool
	ExpectError bool
}

func (*DashboardTest) HasFailed

func (t *DashboardTest) HasFailed(statusCode int) bool

func (*DashboardTest) Request

func (t *DashboardTest) Request() *http.Request

type TrackingTest

type TrackingTest struct {
	Path              string
	ExpectToBeTracked bool
}

func (*TrackingTest) Request

func (t *TrackingTest) Request() *http.Request

Jump to

Keyboard shortcuts

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