testutils

package
v0.0.0-...-24f6000 Latest Latest
Warning

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

Go to latest
Published: Aug 20, 2023 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var TestCases = []TestCase{
	{
		Name:     "Headless Browser Without Incognito",
		Target:   "https://www.hackerone.com/",
		Expected: nil,
		Args:     "-headless -no-incognito -depth 2 -silent",
		CompareFunc: func(target string, got []string) error {
			for _, res := range got {
				if strings.Contains(res, target) {
					return nil
				}
			}
			return errorutils.New("expected %v target in output, but got %v ", target, strings.Join(got, "\n"))
		},
	},
}

Functions

func CompareOutput

func CompareOutput(input, expected []string) bool

func RunKatanaBinaryAndGetResults

func RunKatanaBinaryAndGetResults(target string, katanaBinary string, debug bool, args []string) ([]string, error)

Types

type TestCase

type TestCase struct {
	Name        string
	Target      string
	Args        string
	Expected    []string
	CompareFunc func(target string, got []string) error
}

Jump to

Keyboard shortcuts

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