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

Status code validation error message is wrong #167

Closed
artem-zakharchenko opened this issue May 21, 2019 · 1 comment · Fixed by #168
Closed

Status code validation error message is wrong #167

artem-zakharchenko opened this issue May 21, 2019 · 1 comment · Fixed by #168

Comments

@artem-zakharchenko
Copy link
Contributor

artem-zakharchenko commented May 21, 2019

Upon investigation of the failing Dredd CI after using the newest version of Gavel, I have found out that the error message for non-matching status code is not per spec.

Current behavior

Real and expected data does not match.

This is the default output of the TextDiff validator that Gavel uses for status codes validation.

Expected behavior

Status code is '${real}' instead of '${expected}'

This is an explicit message that has been mapped manually previously:

this.validation.statusCode.results = this.validation.statusCode.results.map(
(current) =>
Object.assign({}, current, {
message:
current.message === 'Real and expected data does not match.'
? `Status code is '${real}' instead of '${expected}'`
: current.message
})
);

It seems that this mapping has been lost during the refactoring. It needs to be added back for Gavel to behave per spec.

@ApiaryBot
Copy link
Collaborator

🎉 This issue has been resolved in version 3.1.1 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
SJS
  
Done
Development

Successfully merging a pull request may close this issue.

2 participants