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

assertObjectMatchSpec improvement #44

Open
plouc opened this issue Jun 20, 2019 · 0 comments · May be fixed by #56
Open

assertObjectMatchSpec improvement #44

plouc opened this issue Jun 20, 2019 · 0 comments · May be fixed by #56

Comments

@plouc
Copy link
Contributor

plouc commented Jun 20, 2019

Do you want to request a feature or report a bug?

An enhancement.

What is the current behavior?

When using the json response should fully match assertion (assertObjectMatchSpec), we use a naive approach which just count the number of props (including nested ones) and compares this to the number of assertions. Also we can only have one assertion per property.

What is the expected behavior?

The problem with this is that the feedback isn't really useful, we should build an array of all the props (full path using dot notation like for _.get()), build another array containing all the props checked, and make a diff, this way we could have several matchers on a single props and have a more useful feedback by indicating which props are missing.

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

Successfully merging a pull request may close this issue.

2 participants