Skip to content

assertObjectMatchSpec improvement #44

Description

@plouc

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.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions