unit_test

command
v0.0.0-...-d4124cb Latest Latest
Warning

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

Go to latest
Published: Jun 24, 2025 License: Apache-2.0 Imports: 1 Imported by: 0

README

Unit Test

You can learn how to write unit tests without network transfer.

We provide two interfaces ResponseRecord and PerformRequest

  • ResponseRecord: It is used to record the response results, you can write serialized response data via Write(buf []byte), and get the hertz.Response object via Result()
  • PerformRequest: It is used to make a request to the specified engine with the specified url. You can provide a test engine and pass in the method, url, and optionally the Body and Header

For more information about unit test, please click unit test

How to run

go test unit_test/main_test.go

Documentation

The Go Gopher

There is no documentation for this package.

Jump to

Keyboard shortcuts

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