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

Dredd reporter should be clearer on difference in response bodies #1104

Open
kylef opened this issue Aug 17, 2018 · 2 comments
Open

Dredd reporter should be clearer on difference in response bodies #1104

kylef opened this issue Aug 17, 2018 · 2 comments
Labels
Epic: CLI reporter Dredd's default reporter

Comments

@kylef
Copy link
Member

kylef commented Aug 17, 2018

Given the following Dredd output, it is telling me that my "plain text" response doesn't match. The problem here is that visually they are pretty identical, I think the only difference is newline perhaps. I think Dredd can do a better job and perhaps actually show a diff between the two so the difference is clearer.

Actual Output

fail: POST (200) /composer duration: 16ms
fail: body: Real and expected data does not match.

request:
method: POST
uri: /composer
headers:
    Content-Type: application/vnd.refract.parse-result+json; version=1.0
    User-Agent: Dredd/5.1.11 (Darwin 17.7.0; x64)
    Content-Length: 2941

body:
{ /* redacted for brevity */ }


expected:
headers:
    Content-Type: text/vnd.apiblueprint

body:
FORMAT: 1A

# Hello API

## Group

### /message

#### GET

+ Response 200 (text/plain)

        Hello World!

statusCode: 200


actual:
statusCode: 200
headers:
    content-type: text/vnd.apiblueprint
    access-control-allow-origin: *
    content-encoding: identity
    date: Fri, 17 Aug 2018 15:45:19 GMT
    connection: close
    transfer-encoding: chunked

body:
FORMAT: 1A

# Hello API

## Group

### /message

#### GET

+ Response 200 (text/plain)

        Hello World!

Expected Output

This perhaps isn't correct, just for example, if the problem was about new line a diff like the following:

  + Response 200 (text/plain)

          Hello World!
+
@kylef kylef added the Epic: CLI reporter Dredd's default reporter label Aug 17, 2018
@kylef
Copy link
Member Author

kylef commented Aug 17, 2018

This is similiar to #305, I am not entirely sure if it is a duplicate as that specifcally mentions whitespace. I am talking more generically that it should be a diff, just happens to be my example is whitespace.

@honzajavorek
Copy link
Contributor

I just scanned through the issue, but I believe your example even touches the #67. But yes, this is generally about nicer diffs in the CLI reporter as being designed in #765 and #305 is only a part of the problem.

@honzajavorek honzajavorek modified the milestone: Improve CLI output Jan 12, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Epic: CLI reporter Dredd's default reporter
Projects
None yet
Development

No branches or pull requests

2 participants