## Testing Test against the CLI (i.e. built commands) should be written in the [e2e directory](e2e). Everything else can go along side the file under test. ### Basics Tests can be run by executing `make test`. Alternatively, you can run `go test ./...` from the repository root to recursively run tests over all sub directories. For basic code coverage, use the `-cover` flag to the total % coverage across your code. You can visualize the test coverage by running the following commands: ```bash # Generate a coverage profile go test -coverprofile=coverage.out # Visualize test coverage in browser go tool cover -html=coverage.out ``` ### Mocks Class mocks are generated by [gomock](https://github.com/golang/mock). See the linked repository for installation and usage instructions. Run the following to generate (or regenerate) mocks for an interface: ```bash mockgen -source interfaces.go -destination mocks/mock_interfaces.go -package mocks ```