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

Feature request: Partial object matchers #141

Closed
bjarketrux opened this issue Oct 6, 2016 · 2 comments
Closed

Feature request: Partial object matchers #141

bjarketrux opened this issue Oct 6, 2016 · 2 comments

Comments

@bjarketrux
Copy link

Currently we can do

var brew = td.function()
td.when(brew(td.matchers.contains({ingredient: 'beans'}))).thenReturn('coffee')

It would be nice to do something like this:

var brew = td.function()
td.when(brew(td.matchers.contains({ ingredient: td.matchers.isA(String) }))).thenReturn('coffee')

Or even:

var brew = td.function()
td.when(brew({ ingredient: td.matchers.isA(String) })).thenReturn('coffee')

This is especially true for complex objects or dates.
Jasmine equivalent

@searls
Copy link
Member

searls commented Oct 7, 2016

I believe this is a dupe of: #109

@searls searls closed this as completed Oct 7, 2016
@bjarketrux
Copy link
Author

Ah yes you are correct. Sorry

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

No branches or pull requests

2 participants