Skip to content

Commit

Permalink
refactor: display mismatches before erroring a test
Browse files Browse the repository at this point in the history
  • Loading branch information
mefellows committed Jun 7, 2021
1 parent e241249 commit fac6a73
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions consumer/http.go
Original file line number Diff line number Diff line change
Expand Up @@ -157,14 +157,13 @@ func (p *httpMockProvider) ExecuteTest(integrationTest func(MockServerConfig) er
TLSConfig: GetTLSConfigForTLSMockServer(),
})

res, mismatches := p.mockserver.Verify(p.config.Port, p.config.PactDir)
p.displayMismatches(mismatches)

if err != nil {
return err
}

// Run Verification Process
res, mismatches := p.mockserver.Verify(p.config.Port, p.config.PactDir)
p.displayMismatches(mismatches)

if !res {
return fmt.Errorf("pact validation failed: %+v %+v", res, mismatches)
}
Expand Down

0 comments on commit fac6a73

Please sign in to comment.