e2e

package
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: Nov 16, 2020 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Overview

A simple library for server-level e2e testing in json

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func E2E

func E2E(t *testing.T, handler http.Handler, path string, ignoreFields []string)

E2E searches recursively for req*.json in the folder you specify by path. Make a request to api using the found json and compare the response to the res*.json of the same name.

Types

type Request

type Request struct {
	Method string      `json:"method"`
	Path   string      `json:"path"`
	Data   interface{} `json:"data"`
}

Request is the format of the `req.json`

type Response

type Response struct {
	Message    string      `json:"message"`
	StatusCode int         `json:"statusCode"`
	Data       interface{} `json:"data"`
}

Response is the format of the `req.json`

Jump to

Keyboard shortcuts

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