Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve console error messages when consumer tests fail #572

Open
1 task done
TimothyJones opened this issue Jan 7, 2021 · 3 comments
Open
1 task done

Improve console error messages when consumer tests fail #572

TimothyJones opened this issue Jan 7, 2021 · 3 comments
Labels
enhancement Indicates new feature requests

Comments

@TimothyJones
Copy link
Contributor

Issue Classification

  • Feature request

Feature Request

Currently, the error messages when a consumer test fails to match the expectations are not very detailled. Many users don't realise they can look in the log to get more detailed errors.

We should improve this behaviour - at a minimum, we could add an error message directing users to the log file.

Ideally, we'd have a detailed copy of the failure that could be logged. For pacts generated with the ruby binaries (the current master release of pact-js uses pact-node's ruby binaries), we could improve the mock service to return detailed information: pact-foundation/pact-mock_service#123

@mefellows
Copy link
Member

This.

@bethesque
Copy link
Member

I've been meaning to do this for a while.

Doesn't the js show the output that says "look at this log file? though"

          Pact::MockService::VerificationFailedError:
            Actual interactions do not match expected interactions for mock Bar.

            Missing requests:
            	GET /thing2

            Unexpected requests:
            	GET /thing

            See log/bar_mock_service.log for details.

@mefellows
Copy link
Member

mefellows commented Jan 8, 2021

It does.

Here's an example failure from the e2e example in the repo:

Screen Shot 2021-01-09 at 10 53 29 am

One option would be to return structured error data + messages in the verification call, which can then be logged using the native JS (or whatever client's) log framework.

EDIT: the provider side log file is not logged to the console, so that would be an improvement on that side of things (I also didn't know it existed for a long time)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Indicates new feature requests
Projects
Status: New Issue
Development

No branches or pull requests

3 participants