func TestMain(m *testing.M) { serv := httptest.NewServer(nil) wt = webtest.New(nil, serv.Listener.Addr().String()) registerHandlers() os.Exit(m.Run()) }
func TestMainFunc(t *testing.T) { wt := webtest.New(t, "localhost:8080") m := testutil.BuildMain(t) defer m.Cleanup() m.Run(nil, func() { wt.WaitForNet() bodyContains(t, wt, "/", "No books found") }) }