Day20 - FAIL AssertionError: check header description

Q re: - Day20 Documentation

I am trying to understand what this test is looking for:

  if (firstRequest.request.header) {
        firstRequest.request.header.forEach( (header) => {
            pm.expect(header.description, 'check header description').to.exist
        })
    }

Hereā€™s the documentation:

ā€¦I get FAIL Documentation added correctly | AssertionError: check header description: expected undefined to exist.

I canā€™t seem to figure out if the test is looking for header info, if so how to write it, or what ā€˜undefined to existā€™ meansā€¦

Thanks

Do you have a description for a request header that you have added? That should only run that check if you have added a header to the request.

Can you share an image of the Headers?

yea, sorry,

I really donā€™t understand this.

I thought the test was for an existing header, that I thought I entered using CURL (BLUE)

RED is just there - I canā€™t add/change it

YELLOW is the header of the call.

Because you have a Header in there (the Accept one at the botton), which is not the auto generated ones, it requires a description (the column next to the vakue).

WOW - you did it again Danny! IDK if I would have figured that out!

Making the description mandatory is really smart documentation-wise!

Thanks again!

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.