testutil

package
v0.0.0-...-498e44a Latest Latest
Warning

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

Go to latest
Published: Jan 14, 2023 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AssertJSON

func AssertJSON(t *testing.T, want, got []byte)

JSONを解析し、比較検証するテスト用ヘルパー

func AssertResponse

func AssertResponse(t *testing.T, got *http.Response, status int, want []byte)

レスポンスと期待値を比較検証するテスト用ヘルパー

func LoadFile

func LoadFile(t *testing.T, path string) []byte

ゴールデンテスト用 入力値・期待値をファイルから取得するテスト用ヘルパー

func OpenDBForTest

func OpenDBForTest(t *testing.T) *sqlx.DB

実DBを使ったテスト用のヘルパー テスト実行環境によって接続先を切り替える

func OpenRedisForTest

func OpenRedisForTest(t *testing.T) *redis.Client

テスト実行環境によって接続先を切り替える

Types

This section is empty.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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