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

Maps status code validation error to contain real/expected status codes #168

Merged
merged 1 commit into from May 21, 2019

Conversation

artem-zakharchenko
Copy link
Contributor

Adds explicit mapping of statusCode validation results to produce expected error messages that include real and expected status codes. Fixes failing tests in Dredd pipeline when using the newest release of Gavel.

GitHub


return {
validator: 'TextDiff',
realType: APIARY_STATUS_CODE_TYPE,
expectedType: APIARY_STATUS_CODE_TYPE,
rawData,
results: validator.evaluateOutputToResults()
results: results.map((result) =>
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's safe to map since the output of evaluateOutputToResults is [] when no errors occurred.

@artem-zakharchenko
Copy link
Contributor Author

I've also updated the tests that didn't seem to assert this validation output previously.

Copy link
Contributor

@honzajavorek honzajavorek left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approved, but I think it is one more proof the validation, in this case of status codes, is totally overengineered. We should simplify the status code validation to a simple three-lines-long comparison in one of the next steps.

@artem-zakharchenko
Copy link
Contributor Author

Absolutely agree. Will be covered in #159. Thanks!

@artem-zakharchenko artem-zakharchenko merged commit 9b42238 into master May 21, 2019
@artem-zakharchenko artem-zakharchenko deleted the 167-status-code-message branch May 21, 2019 12:29
@ApiaryBot
Copy link
Collaborator

🎉 This PR is included 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
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Status code validation error message is wrong
3 participants