Skip to content

Commit

Permalink
Merge pull request #342 from hashicorp/mock-gen-contributing
Browse files Browse the repository at this point in the history
Mock gen contributing
  • Loading branch information
sebasslash committed Mar 2, 2022
2 parents f6d1599 + 6bb3042 commit 6d75cd6
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions docs/CONTRIBUTING.md
Expand Up @@ -271,3 +271,12 @@ func (s *example) Delete(ctx context.Context, exampleID string) error {
return s.client.do(ctx, req, nil)
}
```

## Generating Mocks

To generate mocks, simply run `./generate_mocks.sh`. You'll need to do so if an existing endpoint method is modified or a new method is added. If you're adding a new API resource to go-tfe, you'll need to add the command to `generate_mocks.sh`. For example if someone creates `example_resource.go`, you'll add:

```
mockgen -source=example_resource.go -destination=mocks/example_resource_mocks.go -package=mocks
```

0 comments on commit 6d75cd6

Please sign in to comment.