Skip to content

Latest commit

 

History

22 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Build Status

go-supertest

HTTP assertions made easy for Go via goreq

We love nodejs supertest module and we wanted something like that for Go.

Why?

Because we want to keep HTTP testing in Go plain simple.

Example

import (
        . "github.com/franela/goblin"
        . "github.com/franela/go-supertest"
)

func MyTest(t *testing.T) {
  g := Goblin(t)

  g.Describe("GET /", function() {
    g.It("Should respond 200", function(done Done) {
      NewRequest("http://example.com").
        Get("/").
        Expect(200, done)
    })
  })
}

API

.expect(status[, func])

Assert response status code.

.expect(status, body[, fn])

Assert response status code and body.

Notes

Inspired by supertest.

About

HTTP assertions made easy for Go via goreq

Resources

Stars

34 stars

Watchers

2 watching

Forks

Releases

Packages

Contributors

Languages