Skip to content

Commit

Permalink
Added check on response body and json
Browse files Browse the repository at this point in the history
  • Loading branch information
c4s4 committed Mar 30, 2022
1 parent d14b464 commit ed9e08b
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions executors/tavern/tavern.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import (
"context"
"crypto/tls"
"encoding/json"
"errors"
"fmt"
"io"
"io/ioutil"
Expand Down Expand Up @@ -202,6 +203,10 @@ func (Executor) Run(ctx context.Context, step venom.TestStep) (interface{}, erro
}
}

if e.Response.Body != "" && e.Response.JSON != nil {
return nil, errors.New("you can't set both body and json on response")
}

start := time.Now()
resp, err := client.Do(req)
if err != nil {
Expand Down

0 comments on commit ed9e08b

Please sign in to comment.