goconvey

command module
v1.100.0 Latest Latest
Warning

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

Go to latest
Published: Jan 11, 2021 License: MIT Imports: 23 Imported by: 0

README

GoConvey is awesome Go testing

Build Status GoDoc

Welcome to GoConvey, a yummy Go testing tool for gophers. Works with go test. Use it in the terminal or browser according to your viewing pleasure. View full feature tour.

Features:

  • Directly integrates with go test
  • Fully-automatic web UI (works with native Go tests, too)
  • Huge suite of regression tests
  • Shows test coverage (Go 1.2+)
  • Readable, colorized console output (understandable by any manager, IT or not)
  • Test code generator
  • Desktop notifications (optional)
  • Immediately open problem lines in Sublime Text (some assembly required)

You can ask questions about how to use GoConvey on StackOverflow. Use the tags go and goconvey.

Menu:

Installation

$ go get github.com/privafy/goconvey

Quick start

Make a test, for example:

package package_name

import (
    "testing"
    . "github.com/privafy/goconvey/convey"
)

func TestSpec(t *testing.T) {

	// Only pass t into top-level Convey calls
	Convey("Given some integer with a starting value", t, func() {
		x := 1

		Convey("When the integer is incremented", func() {
			x++

			Convey("The value should be greater by one", func() {
				So(x, ShouldEqual, 2)
			})
		})
	})
}
In the browser

Start up the GoConvey web server at your project's path:

$ $GOPATH/bin/goconvey

Then watch the test results display in your browser at:

http://localhost:8080

If the browser doesn't open automatically, please click http://localhost:8080 to open manually.

There you have it. As long as GoConvey is running, test results will automatically update in your browser window.

The design is responsive, so you can squish the browser real tight if you need to put it beside your code.

The web UI supports traditional Go tests, so use it even if you're not using GoConvey tests.

In the terminal

Just do what you do best:

$ go test

Or if you want the output to include the story:

$ go test -v

Documentation

Check out the

  • GoConvey wiki,
  • GoDoc
  • and the *_test.go files scattered throughout this project.

Screenshots

For web UI and terminal screenshots, check out the full feature tour.

Contributors

GoConvey is brought to you, originally by SmartyStreets, Privafy andseveral contributors (Thanks!).

Documentation

Overview

This executable provides an HTTP server that watches for file system changes to .go files within the working directory (and all nested go packages). Navigating to the configured host and port in a web browser will display the latest results of running `go test` in each go package.

Directories

Path Synopsis
Package convey contains all of the public-facing entry points to this project.
Package convey contains all of the public-facing entry points to this project.
gotest
Package gotest contains internal functionality.
Package gotest contains internal functionality.
reporting
Package reporting contains internal functionality related to console reporting and output.
Package reporting contains internal functionality related to console reporting and output.
Package examples contains, well, examples of how to use goconvey to specify behavior of a system under test.
Package examples contains, well, examples of how to use goconvey to specify behavior of a system under test.
util
assertions
Package assertions contains the implementations for all assertions which are referenced in goconvey's `convey` package (github.com/smartystreets/goconvey/convey) and gunit (github.com/smartystreets/gunit) for use with the So(...) method.
Package assertions contains the implementations for all assertions which are referenced in goconvey's `convey` package (github.com/smartystreets/goconvey/convey) and gunit (github.com/smartystreets/gunit) for use with the So(...) method.
assertions/internal/go-diff/diffmatchpatch
Package diffmatchpatch offers robust algorithms to perform the operations required for synchronizing plain text.
Package diffmatchpatch offers robust algorithms to perform the operations required for synchronizing plain text.
assertions/internal/oglematchers
Package oglematchers provides a set of matchers useful in a testing or mocking framework.
Package oglematchers provides a set of matchers useful in a testing or mocking framework.
assertions/internal/unit
package unit implements a light-weight x-Unit style testing framework.
package unit implements a light-weight x-Unit style testing framework.
assertions/should
package should is simply a rewording of the assertion functions in the assertions package.
package should is simply a rewording of the assertion functions in the assertions package.
gls
Package gls implements goroutine-local storage.
Package gls implements goroutine-local storage.
web
server/watch/integration_testing
This file's only purpose is to provide a realistic environment from which to run integration tests against the Watcher.
This file's only purpose is to provide a realistic environment from which to run integration tests against the Watcher.
server/watch/integration_testing/sub
This file's only purpose is to provide a realistic environment from which to run integration tests against the Watcher.
This file's only purpose is to provide a realistic environment from which to run integration tests against the Watcher.

Jump to

Keyboard shortcuts

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