commandtest

package
v0.0.0-...-19a1b97 Latest Latest
Warning

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

Go to latest
Published: Apr 23, 2024 License: MIT Imports: 17 Imported by: 0

Documentation

Overview

Package commandtest provides helpers for testing commands.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Run

func Run(t *testing.T, tests []Case)

Types

type Case

type Case struct {
	Input      base.IncomingMessage
	Platform   Platform
	OtherTexts []string
	APIResp    string
	APIResps   []string
	ConfigData string
	RunBefore  []SetupFunc
	RunAfter   []TeardownFunc
	Want       []*base.Message
}

Case is a test case for running command tests.

type Platform

type Platform uint8

Platform indicates which platform to consider the message to be sent from.

const (
	TwitchPlatform Platform = iota
)

type SetupFunc

type SetupFunc func(testing.TB, *base.Resources)

SetupFunc is a function to be run before a test case runs.

type TeardownFunc

type TeardownFunc func(testing.TB)

TeardownFunc is a function to be run after a test case runs.

Jump to

Keyboard shortcuts

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