test_utils

package
v13.1.2 Latest Latest
Warning

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

Go to latest
Published: Mar 17, 2026 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Overview

Package test_utils contains types and functions used to simplify creation and execution of unit and functional tests

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ExecuteFunctionalTests

func ExecuteFunctionalTests(t *testing.T, tests []*FunctionalTest, serviceID string)

Types

type FunctionalTest

type FunctionalTest struct {
	// CheckErrorFn is a function which can be used to perform
	// additional validation of the error returned by TestFn; the
	// function will be passed a formatted string containing the
	// test case's name, along with the returned error
	CheckErrorFn func(*testing.T, string, error)
	// Name is the name of the test case, used in error messages
	Name string
	// Operation is the operation being performed, which will be
	// used to construct the recorded fixture file's name
	Operation string
	// TestFn is the function to be called to run the test
	TestFn func(*testing.T, *FunctionalTest, *fastly.Client, string) error
	// WantNoError indicates that the test case should fail if any
	// error is returned by TestFn
	WantNoError bool
	// WantError indicates the error (value, not type) that must
	// be returned by TestFn for this test case
	WantError error
}

Jump to

Keyboard shortcuts

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