Skip to content
Opinionated tool for end-to-end tests of HTTP APIs.
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
examples
src
test
.gitignore
Makefile
README.md

README.md

Diplomat

For usage and documentation, see the wiki.

Development

Get the Source Code

This project uses a version of Go supporting modules, which means you can clone the repository anywhere you want. It also handles dependencies without need of secondary tooling such as Glide.

git clone git@github.com:testdouble/diplomat.git
cd diplomat

Setup

Install go:

# Mac OSX with Homebrew
brew install go

Install bats-core:

# Mac OSX with Homebrew
brew install bats-core

In order to develop on this repository, you'll also need to install Docker.

By default, we use a Docker image version of httpbin to make requests for the bats tests. If you prefer not to use Docker, change the value of TEST_HOST in test/helpers/helpers.bash to point to https://httpbin.org.

Watch Code and Run Tests

The core development script in Makefile is watch:

make watch

This script uses rg --files | entr -rc to watch the code, and run several other make scripts on update. Those scripts can also be run on a one-off basis, if desired (see Makefile). The watch script provides a general-purpose, fast feedback cycle for development, which encourages making small changes and keeping tests green.

Using Mocks

The unit tests in this repository use mockery and testify to generate mocks for each type in the project. These mock files live in mocks, are checked into source control, and should not be manually updated.

If you add or modify any types, you will need to regenerate the mocks.

make generate

Code of Conduct

This project follows Test Double's code of conduct for all community interactions, including (but not limited to) one-on-one communications, public posts/comments, code reviews, pull requests, and GitHub issues. If violations occur, Test Double will take any action they deem appropriate for the infraction, up to and including blocking a user from the organization's repositories.

You can’t perform that action at this time.