Skip to content

Latest commit

 

History

History
30 lines (20 loc) · 892 Bytes

README.md

File metadata and controls

30 lines (20 loc) · 892 Bytes

Web - Testing

Learn the basics of testing web services and applications in Go.

Notes

  • The standard library has a package named httptest with good support.
  • There are several ways to create unit and integration tests in Go.

Links

https://golang.org/pkg/net/http/
https://golang.org/doc/articles/wiki/

Code Review

Basic Unit Testing
Using a http.Handler
Testing Routes
Mocking Servers

Exercises

Exercise 1

Write tests that exercise the different endpoints of the "Hello world" language exercise from the basics. Do this by combining the mux with the defined routes with a httptest.NewServer.


All material is licensed under the Apache License Version 2.0, January 2004.