Install GoConvey
masterInstall the GoConvey tool using go install to make the goconvey binary available in your $GOPATH/bin.
$ go install github.com/smartystreets/goconveyrepository·master·Indexed 27 days ago
https://github.com/smartystreets/goconveyGoConvey is a testing tool for Go that provides a BDD-style syntax and a real-time web UI to visualize test results and coverage. It integrates with the standard go test tool and allows users to define test scopes using the Convey function and assertions using the So function.
Install the GoConvey tool using go install to make the goconvey binary available in your $GOPATH/bin.
$ go install github.com/smartystreets/goconveyYou can run a local web server that watches your tests and automatically updates the results in your browser as you change your code.
goconvey command.http://localhost:8080 in your browser.The Web UI supports both GoConvey-style tests and traditional Go tests.
$ $GOPATH/bin/goconveygo test tool. You can run tests normally, or use the -v flag to see the full test 'story' (the descriptive strings provided in Convey blocks) in your console output.You can include Font Awesome as a component by running the following command or adding it to your component.json dependencies.
$ component install FortAwesome/Font-AwesomeOr add to component.json:
"FortAwesome/Font-Awesome": "*"To build the project or work on its source, you must install the following prerequisites:
sudo apt-get install ruby-dev; on Windows: DevKit)gem install bundlernpm install -g lessnpm install -g less-plugin-clean-cssAfter installing prerequisites, run these commands from the root of the repository to install development tools:
$ bundle install
$ npm installGoConvey uses a BDD-style (Behavior Driven Development) syntax. You use the Convey function to define scopes and the So function to define assertions.
Important: Only pass the *testing.T object into the top-level Convey call. Nested Convey calls should only take the function body.
package package_name
import (
"testing"
. "github.com/smartystreets/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)
})
})
})
}.go files within the working directory. You can customize the server behavior using the following command-line flags:Results method returns the most recent test execution output as a JSON object. It sets headers to prevent caching (Cache-Control: no-cache, etc.). The response includes the Paused state of the executor.These methods allow the user to manage which paths are monitored by the watcher.
messaging.WatcherIgnore command. Requires a paths query parameter (e.g., /ignore?paths=pkg/internal).messaging.WatcherReinstate command. Requires a paths query parameter to re-enable monitoring for specific paths.