Skip to content
This repository has been archived by the owner on Apr 12, 2024. It is now read-only.

feat(ngMock): allow the use of a predicate to match data #3452

Closed
wants to merge 1 commit into from

Conversation

jnizet
Copy link
Contributor

@jnizet jnizet commented Aug 2, 2013

When using $httpBackend, the data in definitions and expectations can only
be defined as a string (which must be matched exactly) or as a regexp.
Both are not very practical when it comes to matching JSON objects. This
commits adds the possibility to pass a predicate function, which should
return a truthy value if the data matches with the expectation and a falsy
value if it doesn't.

When using $httpBackend, the data in definitions and expectations can only
be defined as a string (which must be matched exactly) or as a regexp.
Both are not very practical when it comes to matching JSON objects. This
commits adds the possibility to pass a predicate function, which should
return a truthy value if the data matches with the expectation and a falsy
value if it doesn't.
@mary-poppins
Copy link

Thanks for the PR!

  • Contributor signed CLA now or in the past
    • If you just signed, leave a comment here with your real name
  • PR's commit messages follow the commit message format

If you need to make changes to your pull request, you can update the commit with git commit --amend.
Then, update the pull request with git push -f.

Thanks again for your help!

@jnizet
Copy link
Contributor Author

jnizet commented Aug 2, 2013

My real name is Jean-Baptiste Nizet. I just signed the CLA.
I don't see where my commit message doesn't respect the commit message format, sorry.

@petebacondarwin
Copy link
Contributor

Hi @jnizet - Thanks for this PR. It is actually a duplicate of #2981. So closing and let's see if we can get that one merged.

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

Successfully merging this pull request may close these issues.

3 participants